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
156 struct xbc_node *node;156 struct xbc_node *node;
157 157
158 if (parent)158 if (parent)
159 node = xbc_node_get_child(parent);159 node = xbc_node_get_subkey(parent);
160 else160 else
161 node = xbc_root_node();161 node = xbc_root_node();
162 162
@@ -164,7 +164,7 @@ xbc_node_find_child(struct xbc_node *parent, const char *key) · 1 unmodified line
164 if (!xbc_node_match_prefix(node, &key))164 if (!xbc_node_match_prefix(node, &key))
165 node = xbc_node_get_next(node);165 node = xbc_node_get_next(node);
166 else if (*key != '\0')166 else if (*key != '\0')
167 node = xbc_node_get_child(node);167 node = xbc_node_get_subkey(node);
168 else168 else
169 break;169 break;
170 }170 }
@@ -274,6 +274,8 @@ int __init xbc_node_compose_key_after(struct xbc_node *root, · 103 unmodified lines
274struct xbc_node * __init xbc_node_find_next_leaf(struct xbc_node *root,274struct xbc_node * __init xbc_node_find_next_leaf(struct xbc_node *root,
275 struct xbc_node *node)275 struct xbc_node *node)
276{276{
277 struct xbc_node *next;
278
277 if (unlikely(!xbc_data))279 if (unlikely(!xbc_data))
278 return NULL;280 return NULL;
279 281
@@ -282,6 +284,13 @@ struct xbc_node * __init xbc_node_find_next_leaf(struct xbc_node *root, · 2 unmodified lines
282 if (!node)284 if (!node)
283 node = xbc_nodes;285 node = xbc_nodes;
284 } else {286 } 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
285 if (node == root) /* @root was a leaf, no child node. */294 if (node == root) /* @root was a leaf, no child node. */
286 return NULL;295 return NULL;
287 296
@@ -296,6 +305,7 @@ struct xbc_node * __init xbc_node_find_next_leaf(struct xbc_node *root, · 8 unmodified lines
296 node = xbc_node_get_next(node);305 node = xbc_node_get_next(node);
297 }306 }
298 307
308found:
299 while (node && !xbc_node_is_leaf(node))309 while (node && !xbc_node_is_leaf(node))
300 node = xbc_node_get_child(node);310 node = xbc_node_get_child(node);
301 311
@@ -367,18 +377,28 @@ static inline __init struct xbc_node *xbc_last_sibling(struct xbc_node *node) · 65 unmodified lines
367 return node;377 return node;
368}378}
369 379
370static struct xbc_node * __init xbc_add_sibling(char *data, u32 flag)380static 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
388static struct xbc_node * __init __xbc_add_sibling(char *data, u32 flag, bool head)
371{389{
372 struct xbc_node *sib, *node = xbc_add_node(data, flag);390 struct xbc_node *sib, *node = xbc_add_node(data, flag);
373 391
374 if (node) {392 if (node) {
375 if (!last_parent) {393 if (!last_parent) {
394 /* Ignore @head in this case */
376 node->parent = XBC_NODE_MAX;395 node->parent = XBC_NODE_MAX;
377 sib = xbc_last_sibling(xbc_nodes);396 sib = xbc_last_sibling(xbc_nodes);
378 sib->next = xbc_node_index(node);397 sib->next = xbc_node_index(node);
379 } else {398 } else {
380 node->parent = xbc_node_index(last_parent);399 node->parent = xbc_node_index(last_parent);
381 if (!last_parent->child) {400 if (!last_parent->child || head) {
401 node->next = last_parent->child;
382 last_parent->child = xbc_node_index(node);402 last_parent->child = xbc_node_index(node);
383 } else {403 } else {
384 sib = xbc_node_get_child(last_parent);404 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
392 return node;412 return node;
393}413}
394 414
415static inline struct xbc_node * __init xbc_add_sibling(char *data, u32 flag)
416{
417 return __xbc_add_sibling(data, flag, false);
418}
419
420static inline struct xbc_node * __init xbc_add_head_sibling(char *data, u32 flag)
421{
422 return __xbc_add_sibling(data, flag, true);
423}
424
395static inline __init struct xbc_node *xbc_add_child(char *data, u32 flag)425static inline __init struct xbc_node *xbc_add_child(char *data, u32 flag)
396{426{
397 struct xbc_node *node = xbc_add_sibling(data, flag);427 struct xbc_node *node = xbc_add_sibling(data, flag);
@@ -517,17 +547,20 @@ static int __init xbc_parse_array(char **__v) · 119 unmodified lines
517 char *next;547 char *next;
518 int c = 0;548 int c = 0;
519 549
550 if (last_parent->child)
551 last_parent = xbc_node_get_child(last_parent);
552
520 do {553 do {
521 c = __xbc_parse_value(__v, &next);554 c = __xbc_parse_value(__v, &next);
522 if (c < 0)555 if (c < 0)
523 return c;556 return c;
524 557
525 node = xbc_add_sibling(*__v, XBC_VALUE);558 node = xbc_add_child(*__v, XBC_VALUE);
526 if (!node)559 if (!node)
527 return -ENOMEM;560 return -ENOMEM;
528 *__v = next;561 *__v = next;
529 } while (c == ',');562 } while (c == ',');
530 node->next = 0;563 node->child = 0;
531 564
532 return c;565 return c;
533}566}
@@ -557,8 +590,9 @@ static int __init __xbc_add_key(char *k) · 23 unmodified lines
557 node = find_match_node(xbc_nodes, k);590 node = find_match_node(xbc_nodes, k);
558 else {591 else {
559 child = xbc_node_get_child(last_parent);592 child = xbc_node_get_child(last_parent);
593 /* Since the value node is the first child, skip it. */
560 if (child && xbc_node_is_value(child))594 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);
562 node = find_match_node(child, k);596 node = find_match_node(child, k);
563 }597 }
564 598
@@ -601,23 +635,29 @@ static int __init xbc_parse_kv(char **k, char *v, int op) · 36 unmodified lines
601 if (ret)635 if (ret)
602 return ret;636 return ret;
603 637
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
612 c = __xbc_parse_value(&v, &next);638 c = __xbc_parse_value(&v, &next);
613 if (c < 0)639 if (c < 0)
614 return c;640 return c;
615 641
616 if (op == ':' && child) {642 child = xbc_node_get_child(last_parent);
617 xbc_init_node(child, v, XBC_VALUE);643 if (child && xbc_node_is_value(child)) {
618 } else if (!xbc_add_sibling(v, XBC_VALUE))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))
619 return -ENOMEM;658 return -ENOMEM;
620 659
660array:
621 if (c == ',') { /* Array */661 if (c == ',') { /* Array */
622 c = xbc_parse_array(&next);662 c = xbc_parse_array(&next);
623 if (c < 0)663 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
229 229
230 WARN_ON(s->size == 0);230 WARN_ON(s->size == 0);
231 231
232 BUILD_BUG_ON(MAX_MEMHEX_BYTES * 2 >= HEX_CHARS);
233
232 while (len) {234 while (len) {
233 start_len = min(len, HEX_CHARS - 1);235 start_len = min(len, MAX_MEMHEX_BYTES);
234#ifdef __BIG_ENDIAN236#ifdef __BIG_ENDIAN
235 for (i = 0, j = 0; i < start_len; i++) {237 for (i = 0, j = 0; i < start_len; i++) {
236#else238#else
@@ -243,12 +245,14 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem, · 6 unmodified lines
243 break;245 break;
244 246
245 /* j increments twice per loop */247 /* j increments twice per loop */
246 len -= j / 2;
247 hex[j++] = ' ';248 hex[j++] = ' ';
248 249
249 seq_buf_putmem(s, hex, j);250 seq_buf_putmem(s, hex, j);
250 if (seq_buf_has_overflowed(s))251 if (seq_buf_has_overflowed(s))
251 return -1;252 return -1;
253
254 len -= start_len;
255 data += start_len;
252 }256 }
253 return 0;257 return 0;
254}258}

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