MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /usr/share/systemtap/tapset/LKET/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/systemtap/tapset/LKET/utils.stp
// Copyright (C) 2005, 2006 IBM Corp.
//
// This file is part of systemtap, and is free software.  You can
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.

/* data tracing filter by pid
   return:
	1 - if continue to log the raw data
	0 - return without logging the raw data
 */
function filter_by_pid:long()
%{
	struct task_struct *cur = current;

	if(cur->tgid != _stp_pid)  {
		/* to trace a specific process if we explicitly specify
		   which process we want to trace by:
		    1. stap -c "process_to_trace" ...
		    2. stap -x pid_to_trace ...
		   else we will trace all the processes
		 */ 
		if( _stp_target != 0 && cur->tgid != _stp_target) {
			THIS->__retvalue = 0;
			return;
		}

		THIS->__retvalue = 1;
	} else  /*skip the events generated by stap itself*/
		THIS->__retvalue = 0;
	return;
%}

function reset_maxaction()
%{
	struct context* c;
	int cpu;
	for_each_online_cpu(cpu) {
		c = per_cpu_ptr (contexts, cpu);
		c->actioncount = 0;
	}
%}

Anon7 - 2021