History

Merge tag 'trace-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing updates from Steven Rostedt: - Added option for per CPU threads to the hwlat tracer - Have hwlat tracer handle hotplug CPUs - New tracer: osnoise, that detects latency caused by interrupts, softirqs and scheduling of other tasks. - Added timerlat tracer that creates a thread and measures in detail what sources of latency it has for wake ups. - Removed the "success" field of the sched_wakeup trace event. This has been hardcoded as "1" since 2015, no tooling should be looking at it now. If one exists, we can revert this commit, fix that tool and try to remove it again in the future. - tgid mapping fixed to handle more than PID_MAX_DEFAULT pids/tgids. - New boot command line option "tp_printk_stop", as tp_printk causes trace events to write to console. When user space starts, this can easily live lock the system. Having a boot option to stop just after boot up is useful to prevent that from happening. - Have ftrace_dump_on_oops boot command line option take numbers that match the numbers shown in /proc/sys/kernel/ftrace_dump_on_oops. - Bootconfig clean ups, fixes and enhancements. - New ktest script that tests bootconfig options. - Add tracepoint_probe_register_may_exist() to register a tracepoint without triggering a WARN*() if it already exists. BPF has a path from user space that can do this. All other paths are considered a bug. - Small clean ups and fixes * tag 'trace-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (49 commits) tracing: Resize tgid_map to pid_max, not PID_MAX_DEFAULT tracing: Simplify & fix saved_tgids logic treewide: Add missing semicolons to __assign_str uses tracing: Change variable type as bool for clean-up trace/timerlat: Fix indentation on timerlat_main() trace/osnoise: Make 'noise' variable s64 in run_osnoise() tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing tracing: Fix spelling in osnoise tracer "interferences" -> "interference" Documentation: Fix a typo on trace/osnoise-tracer trace/osnoise: Fix return value on osnoise_init_hotplug_support trace/osnoise: Make interval u64 on osnoise_main trace/osnoise: Fix 'no previous prototype' warnings tracing: Have osnoise_main() add a quiescent state for task rcu seq_buf: Make trace_seq_putmem_hex() support data longer than 8 seq_buf: Fix overflow in seq_buf_putmem_hex() trace/osnoise: Support hotplug operations trace/hwlat: Support hotplug operations trace/hwlat: Protect kdata->kthread with get/put_online_cpus trace: Add timerlat tracer trace: Add osnoise tracer ...

Linus Torvalds committed 5 years ago

Commit 757fa802 parents a70bb58 4030a6e74 files · +4439 −369Browse files

Showing the changes to lib (2 of 74 files). Show all

Unified · Split

2 files
  1. lib/bootconfig.c +58 −18
  2. lib/seq_buf.c +6 −2
lib/bootconfig.c+58−18
@@ -156,7 +156,7 @@ xbc_node_find_child(struct xbc_node *parent, const char *key) · 155 unmodified lines
156156 struct xbc_node *node;
157157
158158 if (parent)
159− node = xbc_node_get_child(parent);
159+ node = xbc_node_get_subkey(parent);
160160 else
161161 node = xbc_root_node();
162162
@@ -164,7 +164,7 @@ xbc_node_find_child(struct xbc_node *parent, const char *key) · 1 unmodified line
164164 if (!xbc_node_match_prefix(node, &key))
165165 node = xbc_node_get_next(node);
166166 else if (*key != '\0')
167− node = xbc_node_get_child(node);
167+ node = xbc_node_get_subkey(node);
168168 else
169169 break;
170170 }
@@ -274,6 +274,8 @@ int __init xbc_node_compose_key_after(struct xbc_node *root, · 103 unmodified lines
274274 struct xbc_node * __init xbc_node_find_next_leaf(struct xbc_node *root,
275275 struct xbc_node *node)
276276 {
277+ struct xbc_node *next;
278+
277279 if (unlikely(!xbc_data))
278280 return NULL;
279281
@@ -282,6 +284,13 @@ struct xbc_node * __init xbc_node_find_next_leaf(struct xbc_node *root, · 2 unmodified lines
282284 if (!node)
283285 node = xbc_nodes;
284286 } else {
287+ /* Leaf node may have a subkey */
288+ next = xbc_node_get_subkey(node);
289+ if (next) {
290+ node = next;
291+ goto found;
292+ }
293+
285294 if (node == root) /* @root was a leaf, no child node. */
286295 return NULL;
287296
@@ -296,6 +305,7 @@ struct xbc_node * __init xbc_node_find_next_leaf(struct xbc_node *root, · 8 unmodified lines
296305 node = xbc_node_get_next(node);
297306 }
298307
308+found:
299309 while (node && !xbc_node_is_leaf(node))
300310 node = xbc_node_get_child(node);
301311
@@ -367,18 +377,28 @@ static inline __init struct xbc_node *xbc_last_sibling(struct xbc_node *node) · 65 unmodified lines
367377 return node;
368378 }
369379
370−static struct xbc_node * __init xbc_add_sibling(char *data, u32 flag)
380+static inline __init struct xbc_node *xbc_last_child(struct xbc_node *node)
381+{
382+ while (node->child)
383+ node = xbc_node_get_child(node);
384+
385+ return node;
386+}
387+
388+static struct xbc_node * __init __xbc_add_sibling(char *data, u32 flag, bool head)
371389 {
372390 struct xbc_node *sib, *node = xbc_add_node(data, flag);
373391
374392 if (node) {
375393 if (!last_parent) {
394+ /* Ignore @head in this case */
376395 node->parent = XBC_NODE_MAX;
377396 sib = xbc_last_sibling(xbc_nodes);
378397 sib->next = xbc_node_index(node);
379398 } else {
380399 node->parent = xbc_node_index(last_parent);
381− if (!last_parent->child) {
400+ if (!last_parent->child || head) {
401+ node->next = last_parent->child;
382402 last_parent->child = xbc_node_index(node);
383403 } else {
384404 sib = xbc_node_get_child(last_parent);
@@ -392,6 +412,16 @@ static struct xbc_node * __init xbc_add_sibling(char *data, u32 flag) · 7 unmodified lines
392412 return node;
393413 }
394414
415+static inline struct xbc_node * __init xbc_add_sibling(char *data, u32 flag)
416+{
417+ return __xbc_add_sibling(data, flag, false);
418+}
419+
420+static inline struct xbc_node * __init xbc_add_head_sibling(char *data, u32 flag)
421+{
422+ return __xbc_add_sibling(data, flag, true);
423+}
424+
395425 static inline __init struct xbc_node *xbc_add_child(char *data, u32 flag)
396426 {
397427 struct xbc_node *node = xbc_add_sibling(data, flag);
@@ -517,17 +547,20 @@ static int __init xbc_parse_array(char **__v) · 119 unmodified lines
517547 char *next;
518548 int c = 0;
519549
550+ if (last_parent->child)
551+ last_parent = xbc_node_get_child(last_parent);
552+
520553 do {
521554 c = __xbc_parse_value(__v, &next);
522555 if (c < 0)
523556 return c;
524557
525− node = xbc_add_sibling(*__v, XBC_VALUE);
558+ node = xbc_add_child(*__v, XBC_VALUE);
526559 if (!node)
527560 return -ENOMEM;
528561 *__v = next;
529562 } while (c == ',');
530− node->next = 0;
563+ node->child = 0;
531564
532565 return c;
533566 }
@@ -557,8 +590,9 @@ static int __init __xbc_add_key(char *k) · 23 unmodified lines
557590 node = find_match_node(xbc_nodes, k);
558591 else {
559592 child = xbc_node_get_child(last_parent);
593+ /* Since the value node is the first child, skip it. */
560594 if (child && xbc_node_is_value(child))
561− return xbc_parse_error("Subkey is mixed with value", k);
595+ child = xbc_node_get_next(child);
562596 node = find_match_node(child, k);
563597 }
564598
@@ -601,23 +635,29 @@ static int __init xbc_parse_kv(char **k, char *v, int op) · 36 unmodified lines
601635 if (ret)
602636 return ret;
603637
604− child = xbc_node_get_child(last_parent);
605− if (child) {
606− if (xbc_node_is_key(child))
607− return xbc_parse_error("Value is mixed with subkey", v);
608− else if (op == '=')
609− return xbc_parse_error("Value is redefined", v);
610− }
611−
612638 c = __xbc_parse_value(&v, &next);
613639 if (c < 0)
614640 return c;
615641
616− if (op == ':' && child) {
617− xbc_init_node(child, v, XBC_VALUE);
618− } else if (!xbc_add_sibling(v, XBC_VALUE))
642+ child = xbc_node_get_child(last_parent);
643+ if (child && xbc_node_is_value(child)) {
644+ if (op == '=')
645+ return xbc_parse_error("Value is redefined", v);
646+ if (op == ':') {
647+ unsigned short nidx = child->next;
648+
649+ xbc_init_node(child, v, XBC_VALUE);
650+ child->next = nidx; /* keep subkeys */
651+ goto array;
652+ }
653+ /* op must be '+' */
654+ last_parent = xbc_last_child(child);
655+ }
656+ /* The value node should always be the first child */
657+ if (!xbc_add_head_sibling(v, XBC_VALUE))
619658 return -ENOMEM;
620659
660+array:
621661 if (c == ',') { /* Array */
622662 c = xbc_parse_array(&next);
623663 if (c < 0)
lib/seq_buf.c+6−2
@@ -229,8 +229,10 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem, · 228 unmodified lines
229229
230230 WARN_ON(s->size == 0);
231231
232+ BUILD_BUG_ON(MAX_MEMHEX_BYTES * 2 >= HEX_CHARS);
233+
232234 while (len) {
233− start_len = min(len, HEX_CHARS - 1);
235+ start_len = min(len, MAX_MEMHEX_BYTES);
234236 #ifdef __BIG_ENDIAN
235237 for (i = 0, j = 0; i < start_len; i++) {
236238 #else
@@ -243,12 +245,14 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem, · 6 unmodified lines
243245 break;
244246
245247 /* j increments twice per loop */
246− len -= j / 2;
247248 hex[j++] = ' ';
248249
249250 seq_buf_putmem(s, hex, j);
250251 if (seq_buf_has_overflowed(s))
251252 return -1;
253+
254+ len -= start_len;
255+ data += start_len;
252256 }
253257 return 0;
254258 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t