| 1 |
#! /usr/bin/env stap |
| 2 |
/* Filename: migrate.stp |
| 3 |
* Author: Ankita Garg <[email protected]> |
| 4 |
* Description: Captures information on the migration of a thread |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU General Public License as published by |
| 8 |
* the Free Software Foundation; either version 2 of the License, or |
| 9 |
* (at your option) any later version. |
| 10 |
* |
| 11 |
* This program is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU General Public License for more details. |
| 15 |
* |
| 16 |
* Copyright (C) IBM Corp. 2009. All Rights Reserved. |
| 17 |
* Copyright (C) 2015 Red Hat Inc. |
| 18 |
* |
| 19 |
*/ |
| 20 |
|
| 21 |
probe kernel.trace("sched_migrate_task") !, kernel.function("__migrate_task") |
| 22 |
{ |
| 23 |
comm = task_execname($p) |
| 24 |
if (comm == @1) { |
| 25 |
printf ("thread %d (%s) is migrating from %d to %d \n", |
| 26 |
task_tid($p), comm, task_cpu($p), |
| 27 |
@choose_defined($new_cpu, $dest_cpu)) |
| 28 |
} |
| 29 |
} |