Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'trace-v4.15-rc4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
"Two more small fixes

- The conversion of enums into their actual numbers to display in the
event format file had an off-by-one bug, that could cause an enum
not to be converted, and break user space parsing tools.

- A fix to a previous fix to bring back the context recursion checks.
The interrupt case checks for NMI, IRQ and softirq, but the softirq
returned the same number regardless if it was set or not, although
the logic would force it to be set if it were hit"

* tag 'trace-v4.15-rc4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Fix converting enum's from the map in trace_event_eval_update()
ring-buffer: Fix duplicate results in mapping context to bits in recursive lock

+16 -3
+1 -2
kernel/trace/ring_buffer.c
··· 2579 2579 bit = RB_CTX_NORMAL; 2580 2580 else 2581 2581 bit = pc & NMI_MASK ? RB_CTX_NMI : 2582 - pc & HARDIRQ_MASK ? RB_CTX_IRQ : 2583 - pc & SOFTIRQ_OFFSET ? 2 : RB_CTX_SOFTIRQ; 2582 + pc & HARDIRQ_MASK ? RB_CTX_IRQ : RB_CTX_SOFTIRQ; 2584 2583 2585 2584 if (unlikely(val & (1 << bit))) 2586 2585 return 1;
+15 -1
kernel/trace/trace_events.c
··· 2213 2213 { 2214 2214 struct trace_event_call *call, *p; 2215 2215 const char *last_system = NULL; 2216 + bool first = false; 2216 2217 int last_i; 2217 2218 int i; 2218 2219 ··· 2221 2220 list_for_each_entry_safe(call, p, &ftrace_events, list) { 2222 2221 /* events are usually grouped together with systems */ 2223 2222 if (!last_system || call->class->system != last_system) { 2223 + first = true; 2224 2224 last_i = 0; 2225 2225 last_system = call->class->system; 2226 2226 } 2227 2227 2228 + /* 2229 + * Since calls are grouped by systems, the likelyhood that the 2230 + * next call in the iteration belongs to the same system as the 2231 + * previous call is high. As an optimization, we skip seaching 2232 + * for a map[] that matches the call's system if the last call 2233 + * was from the same system. That's what last_i is for. If the 2234 + * call has the same system as the previous call, then last_i 2235 + * will be the index of the first map[] that has a matching 2236 + * system. 2237 + */ 2228 2238 for (i = last_i; i < len; i++) { 2229 2239 if (call->class->system == map[i]->system) { 2230 2240 /* Save the first system if need be */ 2231 - if (!last_i) 2241 + if (first) { 2232 2242 last_i = i; 2243 + first = false; 2244 + } 2233 2245 update_event_printk(call, map[i]); 2234 2246 } 2235 2247 }