Skip to content

Commit 09670b8

Browse files
committed
Merge tag 'trace-v6.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull tracing fixes from Steven Rostedt: - Fix accounting of stop_count in file release On opening the trace file, if "pause-on-trace" option is set, it will increment the stop_count. On file release, it checks if stop_count is set, and if so it decrements it. Since this code was originally written, the stop_count can be incremented by other use cases. This makes just checking the stop_count not enough to know if it should be decremented. Add a new iterator flag called "PAUSE" and have it set if the open disables tracing and only decrement the stop_count if that flag is set on close. - Remove length field in trace_seq_printf() of print_synth_event() When printing the synthetic event that has a static length array field, the vsprintf() of the trace_seq_printf() triggered a "(efault)" in the output. That's because the print_fmt replaced the "%.*s" with "%s" causing the arguments to be off. - Fix a bunch of typos * tag 'trace-v6.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: Fix typo in trace_seq.c tracing: Fix typo in trace_probe.c tracing: Fix multiple typos in trace_osnoise.c tracing: Fix multiple typos in trace_events_user.c tracing: Fix typo in trace_events_trigger.c tracing: Fix typo in trace_events_hist.c tracing: Fix typo in trace_events_filter.c tracing: Fix multiple typos in trace_events.c tracing: Fix multiple typos in trace.c tracing: Fix typo in ring_buffer_benchmark.c tracing: Fix multiple typos in ring_buffer.c tracing: Fix typo in fprobe.c tracing: Fix typo in fpgraph.c tracing: Fix fixed array of synthetic event tracing: Fix enabling of tracing on file release
2 parents cc3ee4b + c5108c5 commit 09670b8

15 files changed

Lines changed: 34 additions & 32 deletions

include/linux/trace_events.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ enum trace_iter_flags {
138138
TRACE_FILE_LAT_FMT = 1,
139139
TRACE_FILE_ANNOTATE = 2,
140140
TRACE_FILE_TIME_IN_NS = 4,
141+
TRACE_FILE_PAUSE = 8,
141142
};
142143

143144

kernel/trace/fgraph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ enum {
163163
#define RET_STACK(t, offset) ((struct ftrace_ret_stack *)(&(t)->ret_stack[offset]))
164164

165165
/*
166-
* Each fgraph_ops has a reservered unsigned long at the end (top) of the
166+
* Each fgraph_ops has a reserved unsigned long at the end (top) of the
167167
* ret_stack to store task specific state.
168168
*/
169169
#define SHADOW_STACK_TASK_VARS(ret_stack) \

kernel/trace/fprobe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* fprobe_table: hold 'fprobe_hlist::hlist' for checking the fprobe still
3131
* exists. The key is the address of fprobe instance.
3232
* fprobe_ip_table: hold 'fprobe_hlist::array[*]' for searching the fprobe
33-
* instance related to the funciton address. The key is the ftrace IP
33+
* instance related to the function address. The key is the ftrace IP
3434
* address.
3535
*
3636
* When unregistering the fprobe, fprobe_hlist::fp and fprobe_hlist::array[*].fp

kernel/trace/ring_buffer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ static bool rb_meta_init(struct trace_buffer *buffer, int scratch_size)
17701770
bmeta->total_size = total_size;
17711771
bmeta->buffers_offset = (void *)ptr - (void *)bmeta;
17721772

1773-
/* Zero out the scatch pad */
1773+
/* Zero out the scratch pad */
17741774
memset((void *)bmeta + sizeof(*bmeta), 0, bmeta->buffers_offset - sizeof(*bmeta));
17751775

17761776
return false;
@@ -6089,7 +6089,7 @@ static void rb_clear_buffer_page(struct buffer_page *page)
60896089
* id field, and updated via this function.
60906090
*
60916091
* But for a fixed memory mapped buffer, the id is already assigned for
6092-
* fixed memory ording in the memory layout and can not be used. Instead
6092+
* fixed memory ordering in the memory layout and can not be used. Instead
60936093
* the index of where the page lies in the memory layout is used.
60946094
*
60956095
* For the normal pages, set the buffer page id with the passed in @id
@@ -7669,7 +7669,7 @@ static __init int test_ringbuffer(void)
76697669
/*
76707670
* Show buffer is enabled before setting rb_test_started.
76717671
* Yes there's a small race window where events could be
7672-
* dropped and the thread wont catch it. But when a ring
7672+
* dropped and the thread won't catch it. But when a ring
76737673
* buffer gets enabled, there will always be some kind of
76747674
* delay before other CPUs see it. Thus, we don't care about
76757675
* those dropped events. We care about events dropped after

kernel/trace/ring_buffer_benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ static int __init ring_buffer_benchmark_init(void)
433433
{
434434
int ret;
435435

436-
/* make a one meg buffer in overwite mode */
436+
/* make a one meg buffer in overwrite mode */
437437
buffer = ring_buffer_alloc(1000000, RB_FL_OVERWRITE);
438438
if (!buffer)
439439
return -ENOMEM;

kernel/trace/trace.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ cpumask_var_t __read_mostly tracing_buffer_mask;
125125
* If there is an oops (or kernel panic) and the ftrace_dump_on_oops
126126
* is set, then ftrace_dump is called. This will output the contents
127127
* of the ftrace buffers to the console. This is very useful for
128-
* capturing traces that lead to crashes and outputing it to a
128+
* capturing traces that lead to crashes and outputting it to a
129129
* serial console.
130130
*
131131
* It is default off, but you can enable it with either specifying
@@ -134,7 +134,7 @@ cpumask_var_t __read_mostly tracing_buffer_mask;
134134
* Set 1 if you want to dump buffers of all CPUs
135135
* Set 2 if you want to dump the buffer of the CPU that triggered oops
136136
* Set instance name if you want to dump the specific trace instance
137-
* Multiple instance dump is also supported, and instances are seperated
137+
* Multiple instance dump is also supported, and instances are separated
138138
* by commas.
139139
*/
140140
/* Set to string format zero to disable by default */
@@ -4709,8 +4709,10 @@ __tracing_open(struct inode *inode, struct file *file, bool snapshot)
47094709
* If pause-on-trace is enabled, then stop the trace while
47104710
* dumping, unless this is the "snapshot" file
47114711
*/
4712-
if (!iter->snapshot && (tr->trace_flags & TRACE_ITER(PAUSE_ON_TRACE)))
4712+
if (!iter->snapshot && (tr->trace_flags & TRACE_ITER(PAUSE_ON_TRACE))) {
4713+
iter->iter_flags |= TRACE_FILE_PAUSE;
47134714
tracing_stop_tr(tr);
4715+
}
47144716

47154717
if (iter->cpu_file == RING_BUFFER_ALL_CPUS) {
47164718
for_each_tracing_cpu(cpu) {
@@ -4842,7 +4844,7 @@ static int tracing_release(struct inode *inode, struct file *file)
48424844
if (iter->trace && iter->trace->close)
48434845
iter->trace->close(iter);
48444846

4845-
if (!iter->snapshot && tr->stop_count)
4847+
if (iter->iter_flags & TRACE_FILE_PAUSE)
48464848
/* reenable tracing if it was previously enabled */
48474849
tracing_start_tr(tr);
48484850

@@ -5276,7 +5278,7 @@ int set_tracer_flag(struct trace_array *tr, u64 mask, int enabled)
52765278
return -EINVAL;
52775279
/*
52785280
* An instance must always have it set.
5279-
* by default, that's the global_trace instane.
5281+
* by default, that's the global_trace instance.
52805282
*/
52815283
if (printk_trace == tr)
52825284
update_printk_trace(&global_trace);
@@ -7554,7 +7556,7 @@ char *trace_user_fault_read(struct trace_user_buf_info *tinfo,
75547556
migrate_disable();
75557557

75567558
/*
7557-
* Now preemption is being enabed and another task can come in
7559+
* Now preemption is being enabled and another task can come in
75587560
* and use the same buffer and corrupt our data.
75597561
*/
75607562
preempt_enable_notrace();
@@ -11329,7 +11331,7 @@ __init static void do_allocate_snapshot(const char *name)
1132911331
/*
1133011332
* When allocate_snapshot is set, the next call to
1133111333
* allocate_trace_buffers() (called by trace_array_get_by_name())
11332-
* will allocate the snapshot buffer. That will alse clear
11334+
* will allocate the snapshot buffer. That will also clear
1133311335
* this flag.
1133411336
*/
1133511337
allocate_snapshot = true;

kernel/trace/trace_events.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static bool process_string(const char *fmt, int len, struct trace_event_call *ca
360360
/* Anything else, this isn't a function */
361361
break;
362362
}
363-
/* A function could be wrapped in parethesis, try the next one */
363+
/* A function could be wrapped in parenthesis, try the next one */
364364
s = r + 1;
365365
} while (s < e);
366366

@@ -567,7 +567,7 @@ static void test_event_printk(struct trace_event_call *call)
567567
* If start_arg is zero, then this is the start of the
568568
* first argument. The processing of the argument happens
569569
* when the end of the argument is found, as it needs to
570-
* handle paranthesis and such.
570+
* handle parenthesis and such.
571571
*/
572572
if (!start_arg) {
573573
start_arg = i;
@@ -785,7 +785,7 @@ static int __ftrace_event_enable_disable(struct trace_event_file *file,
785785
*
786786
* When soft_disable is not set but the soft_mode is,
787787
* we do nothing. Do not disable the tracepoint, otherwise
788-
* "soft enable"s (clearing the SOFT_DISABLED bit) wont work.
788+
* "soft enable"s (clearing the SOFT_DISABLED bit) won't work.
789789
*/
790790
if (soft_disable) {
791791
if (atomic_dec_return(&file->sm_ref) > 0)
@@ -1394,7 +1394,7 @@ int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set)
13941394
if (!tr)
13951395
return -ENOENT;
13961396

1397-
/* Modules events can be appened with :mod:<module> */
1397+
/* Modules events can be appended with :mod:<module> */
13981398
mod = strstr(buf, ":mod:");
13991399
if (mod) {
14001400
*mod = '\0';

kernel/trace/trace_events_filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static bool is_not(const char *str)
142142
}
143143

144144
/**
145-
* struct prog_entry - a singe entry in the filter program
145+
* struct prog_entry - a single entry in the filter program
146146
* @target: Index to jump to on a branch (actually one minus the index)
147147
* @when_to_branch: The value of the result of the predicate to do a branch
148148
* @pred: The predicate to execute.

kernel/trace/trace_events_hist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5283,7 +5283,7 @@ hist_trigger_actions(struct hist_trigger_data *hist_data,
52835283
* on the stack, so when the histogram trigger is initialized
52845284
* a percpu array of 4 hist_pad structures is allocated.
52855285
* This will cover every context from normal, softirq, irq and NMI
5286-
* in the very unlikely event that a tigger happens at each of
5286+
* in the very unlikely event that a trigger happens at each of
52875287
* these contexts and interrupts a currently active trigger.
52885288
*/
52895289
struct hist_pad {

kernel/trace/trace_events_synth.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ static enum print_line_t print_synth_event(struct trace_iterator *iter,
375375
n_u64++;
376376
} else {
377377
trace_seq_printf(s, print_fmt, se->fields[i]->name,
378-
STR_VAR_LEN_MAX,
379378
(char *)&entry->fields[n_u64].as_u64,
380379
i == se->n_fields - 1 ? "" : " ");
381380
n_u64 += STR_VAR_LEN_MAX / sizeof(u64);

0 commit comments

Comments
 (0)