Skip to content

Commit 42e9c85

Browse files
committed
Merge tag 'trace-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fixes from Steven Rostedt: "Four small fixes: - Fix a ringbuffer bug for nested events having time go backwards - Fix a config dependency for boot time tracing to depend on synthetic events instead of histograms. - Fix trigger format parsing to handle multiple spaces - Fix bootconfig to handle failures in multiple events" * tag 'trace-v5.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/boottime: Fix kprobe multiple events tracing: Fix event trigger to accept redundant spaces tracing/boot: Fix config dependency for synthedic event ring-buffer: Zero out time extend if it is nested and not absolute
2 parents 52366a1 + 20dc384 commit 42e9c85

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

‎kernel/trace/ring_buffer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2427,7 +2427,7 @@ rb_update_event(struct ring_buffer_per_cpu *cpu_buffer,
24272427
if (unlikely(info->add_timestamp)) {
24282428
bool abs = ring_buffer_time_stamp_abs(cpu_buffer->buffer);
24292429

2430-
event = rb_add_time_stamp(event, info->delta, abs);
2430+
event = rb_add_time_stamp(event, abs ? info->delta : delta, abs);
24312431
length -= RB_LEN_TIME_EXTEND;
24322432
delta = 0;
24332433
}

‎kernel/trace/trace_boot.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ trace_boot_add_kprobe_event(struct xbc_node *node, const char *event)
101101
kprobe_event_cmd_init(&cmd, buf, MAX_BUF_LEN);
102102

103103
ret = kprobe_event_gen_cmd_start(&cmd, event, val);
104-
if (ret)
104+
if (ret) {
105+
pr_err("Failed to generate probe: %s\n", buf);
105106
break;
107+
}
106108

107109
ret = kprobe_event_gen_cmd_end(&cmd);
108-
if (ret)
110+
if (ret) {
109111
pr_err("Failed to add probe: %s\n", buf);
112+
break;
113+
}
110114
}
111115

112116
return ret;
@@ -120,7 +124,7 @@ trace_boot_add_kprobe_event(struct xbc_node *node, const char *event)
120124
}
121125
#endif
122126

123-
#ifdef CONFIG_HIST_TRIGGERS
127+
#ifdef CONFIG_SYNTH_EVENTS
124128
static int __init
125129
trace_boot_add_synth_event(struct xbc_node *node, const char *event)
126130
{

‎kernel/trace/trace_events_trigger.c‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,17 @@ static int event_trigger_regex_open(struct inode *inode, struct file *file)
216216

217217
int trigger_process_regex(struct trace_event_file *file, char *buff)
218218
{
219-
char *command, *next = buff;
219+
char *command, *next;
220220
struct event_command *p;
221221
int ret = -EINVAL;
222222

223+
next = buff = skip_spaces(buff);
223224
command = strsep(&next, ": \t");
225+
if (next) {
226+
next = skip_spaces(next);
227+
if (!*next)
228+
next = NULL;
229+
}
224230
command = (command[0] != '!') ? command : command + 1;
225231

226232
mutex_lock(&trigger_cmd_mutex);
@@ -630,8 +636,14 @@ event_trigger_callback(struct event_command *cmd_ops,
630636
int ret;
631637

632638
/* separate the trigger from the filter (t:n [if filter]) */
633-
if (param && isdigit(param[0]))
639+
if (param && isdigit(param[0])) {
634640
trigger = strsep(&param, " \t");
641+
if (param) {
642+
param = skip_spaces(param);
643+
if (!*param)
644+
param = NULL;
645+
}
646+
}
635647

636648
trigger_ops = cmd_ops->get_trigger_ops(cmd, trigger);
637649

@@ -1368,6 +1380,11 @@ int event_enable_trigger_func(struct event_command *cmd_ops,
13681380
trigger = strsep(&param, " \t");
13691381
if (!trigger)
13701382
return -EINVAL;
1383+
if (param) {
1384+
param = skip_spaces(param);
1385+
if (!*param)
1386+
param = NULL;
1387+
}
13711388

13721389
system = strsep(&trigger, ":");
13731390
if (!trigger)

0 commit comments

Comments
 (0)