Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-03-2006, 07:12 PM   #1
Registered: Jan 2004
Location: Pakistan
Distribution: OpenSuse 10.2, Slackware 11, Solaris 10
Posts: 415

Rep: Reputation: 34
what are *.stp files?


I'm trying to run this script, but its not an ordinary script, that is executed via an interpreter. I'm on Slackware 10.2, and when I try to run this script I get:

/usr/bin/env: stap: No such file or directory

The script is as follows:

#!/usr/bin/env stap

# This is an example of profiling a specific command or pid.
# It works by recording the time when a system call is entered
# exited. 

# Usage: prof.stp -c "top -n5"
# Will start up "top" and after 5 iterations, will exit.
# Usage: prof.stp -x 3323
# Will profile pid 3323 until it ^c is hit.

probe kernel.function("sys_*") {
	if (target() == tid())
		calltime[tid()] = gettimeofday_us()

probe kernel.function("sys_*").return {
	if (target() != tid())  next
	now = gettimeofday_us()
	c = calltime[tid()]
	if (!c) next
	ttime[probefunc()] <<< now - c
	delete calltime[tid()]

probe end {
	foreach (x in ttime)
		printf("%-20s\tcalls:%6d\tavg time (ms):%5d\ttotal(ms):%7d\n", 
			x, @count(ttime[x]), @avg(ttime[x]), @sum(ttime[x]))

global calltime, ttime
Old 10-03-2006, 10:37 PM   #2
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 735

Rep: Reputation: 76

Google is your friend. Among the 30K hits:
The stap program is the front-end to the Systemtap tool. It accepts probing instructions (written in a simple scripting language), translates those instructions into C code, compiles this C code, and loads the resulting kernel module into a running Linux kernel to perform the requested system trace/probe functions. You can supply the script in a named file, from standard input, or from the command line. The program runs until it is interrupted by the user, or if the script voluntarily invokes the exit() function, or by sufficient number of soft errors.
Best wishes ... cheers, makyo

Last edited by makyo; 10-03-2006 at 10:39 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to open file with stp extention in SuSE 10.1 riba43 SUSE / openSUSE 2 07-24-2006 11:55 AM
converting a doc/ppt Windows files in html files under linux env agrosu Programming 7 02-23-2006 03:07 PM
STP (Spanning Tree) on Bridge slacky Linux - Networking 5 12-06-2005 09:15 AM
Linux bridge with iptables and STP wkm001 Linux - Networking 1 02-04-2004 01:37 PM
How to filter files in files and files which are in a sub-directory with "grep"? Piero Linux - Newbie 9 08-29-2003 02:38 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration