This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Help required with a script
- From: beginner966 <nitin966 at gmail dot com>
- To: systemtap at sourceware dot org
- Date: Mon, 12 Jan 2009 08:48:46 -0800 (PST)
- Subject: Help required with a script
Hello,
This is the script which I had written to gather information on migration of
task to other CPU. I also wanted to report the appropriate errors, so I had
used 4 kernel.statement probes. But the problem is that all 4
kernel.statement probes get executed simultaneously, which should not happen
according to the original code. Please help in tracing the problem. Thanks.
Uname -r for the kernel is : 2.6.26.5-rt9
#! /usr/bin/env stap
probe kernel.function("__migrate_task")
{
printf("\n__migrate_task called for process: \npid : %d\nSource CPU
: %d\tDestination CPU : %d",$p->pid,$src_cpu,$dest_cpu);
printf("\nState: %d",task_state(task_current()))
print_stack(backtrace())
}
/*
* 6293: if (unlikely(cpu_is_offline(dest_cpu)))
* 6294: return ret;
*/
probe kernel.statement("*@kernel/sched.c:6294")
{
printf("\nError: Process failed to migrate. Destination CPU
(CPU %d) is offline.\n\n",$dest_cpu);
}
/*
* 6307: if (task_cpu(p) != src_cpu)
* 6308: goto done;
*/
probe kernel.statement("*@kernel/sched.c:6308")
{
printf("\nTask already migrated to CPU %d\n\n",$dest_cpu);
}
/*
* 6310: if (!cpu_isset(dest_cpu, p->cpus_allowed))
* 6311: goto fail;
*/
probe kernel.statement("*@kernel/sched.c:6311")
{
printf("\nError: Process failed to migrate to CPU %d. CPU
affinity of current task has changed.",$dest_cpu);
}
/*
* 6317: set_task_cpu(p, dest_cpu);
*/
probe kernel.statement("*@kernel/sched.c:6317")
{
printf("\nSuccess: Task successfully migrated\n\n");
}
--
View this message in context: http://www.nabble.com/Help-required-with-a-script-tp21418350p21418350.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.