mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
tracing: Have traceon and traceoff trigger honor the instance
commit 302e9edd54985f584cfc180098f3554774126969 upstream.
If a trigger is set on an event to disable or enable tracing within an
instance, then tracing should be disabled or enabled in the instance and
not at the top level, which is confusing to users.
Link: https://lkml.kernel.org/r/[email protected]
Cc: [email protected]
Fixes: ae63b31e4d ("tracing: Separate out trace events from global variables")
Tested-by: Daniel Bristot de Oliveira <[email protected]>
Reviewed-by: Tom Zanussi <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
901206f71e
commit
cb90ab3f09
1 changed files with 46 additions and 6 deletions
|
|
@ -940,6 +940,16 @@ static void
|
|||
traceon_trigger(struct event_trigger_data *data, void *rec,
|
||||
struct ring_buffer_event *event)
|
||||
{
|
||||
struct trace_event_file *file = data->private_data;
|
||||
|
||||
if (file) {
|
||||
if (tracer_tracing_is_on(file->tr))
|
||||
return;
|
||||
|
||||
tracer_tracing_on(file->tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (tracing_is_on())
|
||||
return;
|
||||
|
||||
|
|
@ -950,8 +960,15 @@ static void
|
|||
traceon_count_trigger(struct event_trigger_data *data, void *rec,
|
||||
struct ring_buffer_event *event)
|
||||
{
|
||||
if (tracing_is_on())
|
||||
return;
|
||||
struct trace_event_file *file = data->private_data;
|
||||
|
||||
if (file) {
|
||||
if (tracer_tracing_is_on(file->tr))
|
||||
return;
|
||||
} else {
|
||||
if (tracing_is_on())
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data->count)
|
||||
return;
|
||||
|
|
@ -959,13 +976,26 @@ traceon_count_trigger(struct event_trigger_data *data, void *rec,
|
|||
if (data->count != -1)
|
||||
(data->count)--;
|
||||
|
||||
tracing_on();
|
||||
if (file)
|
||||
tracer_tracing_on(file->tr);
|
||||
else
|
||||
tracing_on();
|
||||
}
|
||||
|
||||
static void
|
||||
traceoff_trigger(struct event_trigger_data *data, void *rec,
|
||||
struct ring_buffer_event *event)
|
||||
{
|
||||
struct trace_event_file *file = data->private_data;
|
||||
|
||||
if (file) {
|
||||
if (!tracer_tracing_is_on(file->tr))
|
||||
return;
|
||||
|
||||
tracer_tracing_off(file->tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!tracing_is_on())
|
||||
return;
|
||||
|
||||
|
|
@ -976,8 +1006,15 @@ static void
|
|||
traceoff_count_trigger(struct event_trigger_data *data, void *rec,
|
||||
struct ring_buffer_event *event)
|
||||
{
|
||||
if (!tracing_is_on())
|
||||
return;
|
||||
struct trace_event_file *file = data->private_data;
|
||||
|
||||
if (file) {
|
||||
if (!tracer_tracing_is_on(file->tr))
|
||||
return;
|
||||
} else {
|
||||
if (!tracing_is_on())
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data->count)
|
||||
return;
|
||||
|
|
@ -985,7 +1022,10 @@ traceoff_count_trigger(struct event_trigger_data *data, void *rec,
|
|||
if (data->count != -1)
|
||||
(data->count)--;
|
||||
|
||||
tracing_off();
|
||||
if (file)
|
||||
tracer_tracing_off(file->tr);
|
||||
else
|
||||
tracing_off();
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in a new issue