public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Help required with a script
@ 2009-01-12 16:49 beginner966
  2009-01-12 19:09 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: beginner966 @ 2009-01-12 16:49 UTC (permalink / raw)
  To: systemtap


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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-12 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-12 16:49 Help required with a script beginner966
2009-01-12 19:09 ` Frank Ch. Eigler
2009-01-12 19:33   ` beginner966

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).