Steven Rostedt (Red Hat)
4449bf927b
tracing: Add __bitmask() macro to trace events to cpumasks and other bitmasks
...
Being able to show a cpumask of events can be useful as some events
may affect only some CPUs. There is no standard way to record the
cpumask and converting it to a string is rather expensive during
the trace as traces happen in hotpaths. It would be better to record
the raw event mask and be able to parse it at print time.
The following macros were added for use with the TRACE_EVENT() macro:
__bitmask()
__assign_bitmask()
__get_bitmask()
To test this, I added this to the sched_migrate_task event, which
looked like this:
TRACE_EVENT(sched_migrate_task,
TP_PROTO(struct task_struct *p, int dest_cpu, const struct cpumask *cpus),
TP_ARGS(p, dest_cpu, cpus),
TP_STRUCT__entry(
__array( char, comm, TASK_COMM_LEN )
__field( pid_t, pid )
__field( int, prio )
__field( int, orig_cpu )
__field( int, dest_cpu )
__bitmask( cpumask, num_possible_cpus() )
),
TP_fast_assign(
memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
__entry->pid = p->pid;
__entry->prio = p->prio;
__entry->orig_cpu = task_cpu(p);
__entry->dest_cpu = dest_cpu;
__assign_bitmask(cpumask, cpumask_bits(cpus), num_possible_cpus());
),
TP_printk("comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d cpumask=%s",
__entry->comm, __entry->pid, __entry->prio,
__entry->orig_cpu, __entry->dest_cpu,
__get_bitmask(cpumask))
);
With the output of:
ksmtuned-3613 [003] d..2 485.220508: sched_migrate_task: comm=ksmtuned pid=3615 prio=120 orig_cpu=3 dest_cpu=2 cpumask=00000000,0000000f
migration/1-13 [001] d..5 485.221202: sched_migrate_task: comm=ksmtuned pid=3614 prio=120 orig_cpu=1 dest_cpu=0 cpumask=00000000,0000000f
awk-3615 [002] d.H5 485.221747: sched_migrate_task: comm=rcu_preempt pid=7 prio=120 orig_cpu=0 dest_cpu=1 cpumask=00000000,000000ff
migration/2-18 [002] d..5 485.222062: sched_migrate_task: comm=ksmtuned pid=3615 prio=120 orig_cpu=2 dest_cpu=3 cpumask=00000000,0000000f
Link: http://lkml.kernel.org/r/1399377998-14870-6-git-send-email-javi.merino@arm.com
Link: http://lkml.kernel.org/r/20140506132238.22e136d1@gandalf.local.home
Suggested-by: Javi Merino <javi.merino@arm.com >
Tested-by: Javi Merino <javi.merino@arm.com >
Signed-off-by: Steven Rostedt <rostedt@goodmis.org >
2014-05-15 11:29:37 -04:00
..
2014-01-30 17:20:32 -08:00
2014-03-07 09:18:23 +01:00
2014-04-04 21:08:20 -07:00
2014-04-05 15:46:37 -07:00
2014-04-04 21:07:28 -07:00
2014-04-03 16:21:12 -07:00
2014-03-19 14:41:58 +09:00
2014-03-28 20:42:01 +01:00
2014-02-19 14:58:17 +01:00
2014-04-09 08:45:40 -07:00
2014-02-15 10:58:17 +00:00
2014-03-30 13:25:19 -07:00
2014-03-08 23:32:26 -08:00
2014-04-10 09:06:10 -07:00
2014-03-28 16:29:35 -04:00
2014-04-10 18:43:32 -07:00
2014-04-09 08:39:39 -07:00
2014-04-18 16:40:08 -07:00
2014-04-08 10:56:12 +02:00
2014-03-09 12:45:08 +05:30
2014-04-10 09:06:10 -07:00
2014-03-26 16:58:11 +00:00
2014-02-22 18:14:13 +01:00
2014-04-02 16:23:38 -07:00
2014-01-24 22:39:54 +01:00
2014-04-12 17:31:22 -07:00
2014-04-02 20:53:45 -07:00
2014-02-11 23:30:50 +05:30
2014-04-01 15:14:04 -07:00
2014-02-22 17:13:01 -05:00
2014-02-12 17:21:22 +00:00
2014-04-10 17:51:29 -04:00
2014-04-03 16:20:49 -07:00
2014-04-03 16:21:09 -07:00
2014-02-06 10:33:47 +01:00
2014-04-07 16:36:05 -07:00
2014-04-12 14:49:50 -07:00
2014-03-30 17:02:06 -07:00
2014-04-09 21:54:06 -06:00
2014-03-13 09:38:42 -06:00
2014-04-01 19:19:15 -07:00
2014-04-12 14:49:50 -07:00
2014-01-30 16:56:54 -08:00
2014-02-14 00:27:58 -05:00
2014-04-01 23:19:19 -04:00
2014-01-23 16:36:56 -08:00
2014-02-09 09:59:23 +08:00
2014-02-08 10:36:58 -05:00
2014-03-29 09:15:54 -04:00
2014-03-24 17:10:07 -07:00
2014-02-24 17:13:55 -08:00
2014-02-09 15:11:47 +01:00
2014-04-02 12:51:41 -07:00
2014-04-09 13:44:35 -07:00
2014-02-13 12:34:05 +01:00
2014-01-23 18:11:00 -08:00
2014-04-09 13:44:35 -07:00
2014-02-07 15:40:17 -08:00
2014-04-07 14:55:46 -07:00
2014-02-18 12:38:37 -08:00
2014-04-07 14:43:50 +02:00
2014-03-11 11:52:47 +01:00
2014-04-03 16:20:58 -07:00
2014-03-13 15:56:44 +01:00
2014-04-07 16:36:06 -07:00
2014-04-03 16:21:05 -07:00
2014-04-01 17:08:43 +02:00
2014-03-27 16:56:24 -04:00
2014-04-16 11:56:33 -07:00
2014-02-13 10:08:52 +05:30
2014-03-06 20:41:15 +05:30
2014-03-24 14:05:08 +00:00
2014-02-17 16:46:48 +01:00
2014-02-17 16:50:37 +01:00
2014-02-17 14:16:54 +05:30
2014-03-05 18:15:37 +00:00
2014-02-24 14:46:38 -08:00
2014-04-03 16:21:06 -07:00
2014-02-12 17:33:03 -05:00
2014-03-19 14:41:58 +09:00
2014-02-27 19:56:09 +09:00
2014-04-01 23:19:14 -04:00
2014-03-10 11:44:42 -04:00
2014-04-14 16:26:47 -04:00
2014-03-07 10:19:57 -05:00
2014-02-28 15:12:09 -08:00
2014-04-12 14:49:50 -07:00
2014-02-18 12:20:45 -08:00
2014-04-03 16:20:51 -07:00
2014-05-15 11:29:37 -04:00
2014-05-14 11:37:30 -04:00
2014-03-03 11:32:08 +01:00
2014-01-23 16:36:52 -08:00
2014-03-10 17:26:19 -07:00
2014-02-20 14:54:28 +01:00
2014-02-19 17:22:44 +01:00
2014-03-13 12:48:32 +01:00
2014-02-17 17:12:47 +01:00
2014-04-02 16:24:28 -07:00
2014-04-01 19:06:50 +02:00
2014-04-04 09:12:49 +02:00
2014-03-20 12:35:45 +01:00
2014-03-04 07:55:47 -08:00
2014-02-08 10:36:58 -05:00
2014-04-03 16:20:59 -07:00
2014-04-16 14:14:07 -07:00
2014-01-29 20:40:08 +01:00
2014-03-05 17:16:45 +01:00
2014-04-07 16:36:07 -07:00
2014-03-20 11:53:20 -04:00
2014-03-26 16:41:28 -04:00
2014-03-07 11:41:32 -05:00
2014-02-13 20:24:13 -08:00
2014-03-24 14:07:31 +00:00
2014-02-19 17:22:44 +01:00
2014-04-07 16:36:11 -07:00
2014-02-26 14:42:09 -07:00
2014-03-04 17:51:06 +01:00
2014-02-25 15:25:45 -08:00
2014-01-27 21:02:39 -08:00
2014-04-17 12:30:40 -07:00
2014-04-17 12:23:07 -07:00
2014-02-21 21:49:07 +01:00
2014-03-14 13:43:33 +01:00
2014-03-13 12:11:00 +10:30
2014-03-31 00:45:09 -04:00
2014-04-01 11:22:57 -07:00
2014-04-06 09:38:07 -07:00
2014-03-08 22:08:29 -08:00
2014-03-06 16:30:46 +01:00
2014-02-19 14:58:17 +01:00
2014-01-25 08:55:09 +01:00
2014-04-03 16:20:50 -07:00
2014-04-03 16:21:04 -07:00
2014-05-05 22:40:53 -04:00
2014-03-21 13:43:13 +01:00
2014-04-07 16:36:14 -07:00
2014-03-19 16:30:23 -04:00
2014-02-13 20:21:59 -08:00
2014-04-03 16:21:01 -07:00
2014-03-31 14:13:25 -07:00
2014-03-18 19:19:41 -04:00
2014-02-28 15:36:37 -08:00
2014-04-16 15:09:51 -04:00
2014-03-12 00:16:56 +00:00
2014-04-07 16:36:13 -07:00
2014-04-07 16:35:54 -07:00
2014-04-02 20:53:45 -07:00
2014-04-13 13:28:13 -07:00
2014-04-12 12:38:53 -07:00
2014-04-07 16:35:55 -07:00
2014-04-03 16:21:01 -07:00
2014-04-09 13:44:35 -07:00
2014-04-06 09:38:07 -07:00
2014-03-24 12:21:00 +10:30
2014-04-01 23:19:08 -04:00
2014-03-04 13:51:06 -05:00
2014-01-27 21:02:39 -08:00
2014-03-11 12:14:56 +01:00
2014-04-01 23:19:10 -04:00
2014-04-03 14:31:34 -04:00
2014-04-03 14:29:12 -04:00
2014-03-29 17:58:37 -04:00
2014-03-17 15:14:16 -04:00
2014-03-17 15:15:21 -04:00
2014-04-03 16:21:26 -07:00
2014-04-01 16:25:51 -04:00
2014-01-25 03:14:05 -05:00
2014-04-07 10:59:19 -07:00
2014-04-11 16:45:59 -07:00
2014-02-05 10:04:37 -06:00
2014-03-11 17:26:47 +00:00
2014-03-07 16:02:46 +01:00
2014-03-10 22:42:28 -07:00
2014-03-11 17:27:12 +00:00
2014-04-18 08:36:10 -05:00
2014-04-04 00:31:49 +01:00
2014-02-06 13:48:51 -08:00
2014-04-03 16:21:04 -07:00
2014-04-03 16:21:00 -07:00
2014-01-23 16:36:55 -08:00
2014-04-01 18:49:04 -07:00
2014-02-06 17:31:52 +01:00
2014-03-19 15:11:19 -06:00
2014-01-23 20:17:18 +00:00
2014-04-07 16:36:14 -07:00
2014-03-20 13:43:40 +01:00
2014-04-16 14:36:12 -04:00
2014-04-12 14:49:50 -07:00
2014-02-11 00:36:00 +01:00
2014-03-02 00:18:15 +01:00
2014-03-20 13:25:54 +01:00
2014-01-25 23:58:17 -05:00
2014-01-28 08:38:04 -08:00
2014-01-23 14:48:35 +01:00
2014-04-03 16:21:08 -07:00
2014-04-01 16:43:18 -04:00
2014-03-21 14:21:13 -04:00
2014-02-10 11:16:39 +01:00
2014-03-21 18:26:03 +01:00
2014-04-03 16:20:54 -07:00
2014-04-03 16:21:01 -07:00
2014-01-23 16:36:58 -08:00
2014-03-19 22:24:08 -04:00
2014-02-17 15:01:52 -08:00
2014-03-31 11:05:24 -07:00
2014-03-20 17:12:25 -07:00
2014-03-20 17:12:25 -07:00
2014-04-16 08:56:09 +02:00
2014-04-01 16:13:21 -07:00
2014-04-07 16:35:54 -07:00
2014-03-09 19:53:45 +01:00
2014-04-07 16:36:07 -07:00
2014-03-20 22:09:09 -07:00
2014-01-28 13:20:09 -08:00
2014-04-12 12:38:53 -07:00
2014-03-31 00:45:09 -04:00
2014-04-01 17:08:43 +02:00
2014-02-28 16:27:18 -08:00
2014-03-21 04:12:33 +09:00
2014-03-17 16:20:49 -07:00
2014-02-04 10:22:39 +09:00
2014-01-27 21:02:39 -08:00
2014-04-03 16:21:00 -07:00
2014-04-02 20:53:45 -07:00
2014-01-25 11:17:34 -08:00
2014-04-13 13:28:13 -07:00
2014-04-07 16:36:13 -07:00
2014-02-24 14:47:15 -08:00
2014-01-27 21:02:40 -08:00
2014-02-15 11:55:28 -08:00
2014-02-17 15:01:37 -08:00
2014-03-19 08:58:30 +00:00
2014-04-03 16:21:01 -07:00
2014-03-26 16:49:31 -04:00
2014-04-12 13:06:10 -07:00
2014-04-16 11:56:33 -07:00
2014-02-26 17:08:40 -05:00
2014-04-07 16:36:13 -07:00
2014-02-23 09:04:27 -08:00
2014-05-15 11:29:37 -04:00
2014-05-07 12:10:51 -04:00
2014-02-18 12:50:26 -08:00
2014-04-02 20:53:45 -07:00
2014-03-14 22:41:36 -04:00
2014-02-12 15:00:34 -08:00
2014-04-01 23:19:21 -04:00
2014-03-18 16:39:34 -04:00
2014-03-04 15:38:16 -08:00
2014-04-01 17:06:09 -07:00
2014-02-26 11:38:39 -07:00
2014-04-03 16:21:04 -07:00
2014-04-07 16:35:53 -07:00
2014-04-07 16:36:14 -07:00
2014-01-23 16:37:04 -08:00
2014-04-18 16:40:08 -07:00
2014-02-28 14:08:26 -05:00
2014-04-01 11:00:07 -07:00
2014-04-07 16:35:57 -07:00
2014-01-30 16:56:55 -08:00