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-v7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing fixes from Steven Rostedt:

- Fix inverted check of registering the stats for branch tracing

When calling register_stat_tracer() which returns zero on success and
negative on error, the callers were checking the return of zero as an
error and printing a warning message. Because this was just a normal
printk() message and not a WARN(), it wasn't caught in any testing.

Fix the check to print the warning message when an error actually
happens.

- Fix a typo in a comment in tracepoint.h

- Limit the size of event probes to 3K in size

It is possible to create a dynamic event probe via the tracefs system
that is greater than the max size of an event that the ring buffer
can hold. This basically causes the event to become useless.

Limit the size of an event probe to be 3K as that should be large
enough to handle any dynamic events being created, and fits within
the PAGE_SIZE sub-buffers of the ring buffer.

* tag 'trace-v7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
tracing/probes: Limit size of event probe to 3K
tracepoint: Fix typo in tracepoint.h comment
tracing: branch: Fix inverted check on stat tracer registration

+14 -6
+1 -1
include/linux/tracepoint.h
··· 202 202 #define TP_CONDITION(args...) args 203 203 204 204 /* 205 - * Individual subsystem my have a separate configuration to 205 + * Individual subsystem may have a separate configuration to 206 206 * enable their tracepoints. By default, this file will create 207 207 * the tracepoints if CONFIG_TRACEPOINTS is defined. If a subsystem 208 208 * wants to be able to disable its tracepoints from being created
+4 -4
kernel/trace/trace_branch.c
··· 373 373 int ret; 374 374 375 375 ret = register_stat_tracer(&annotated_branch_stats); 376 - if (!ret) { 376 + if (ret) { 377 377 printk(KERN_WARNING "Warning: could not register " 378 378 "annotated branches stats\n"); 379 - return 1; 379 + return ret; 380 380 } 381 381 return 0; 382 382 } ··· 438 438 int ret; 439 439 440 440 ret = register_stat_tracer(&all_branch_stats); 441 - if (!ret) { 441 + if (ret) { 442 442 printk(KERN_WARNING "Warning: could not register " 443 443 "all branches stats\n"); 444 - return 1; 444 + return ret; 445 445 } 446 446 return 0; 447 447 }
+6
kernel/trace/trace_probe.c
··· 1523 1523 parg->offset = *size; 1524 1524 *size += parg->type->size * (parg->count ?: 1); 1525 1525 1526 + if (*size > MAX_PROBE_EVENT_SIZE) { 1527 + ret = -E2BIG; 1528 + trace_probe_log_err(ctx->offset, EVENT_TOO_BIG); 1529 + goto fail; 1530 + } 1531 + 1526 1532 if (parg->count) { 1527 1533 len = strlen(parg->type->fmttype) + 6; 1528 1534 parg->fmt = kmalloc(len, GFP_KERNEL);
+3 -1
kernel/trace/trace_probe.h
··· 38 38 #define MAX_BTF_ARGS_LEN 128 39 39 #define MAX_DENTRY_ARGS_LEN 256 40 40 #define MAX_STRING_SIZE PATH_MAX 41 + #define MAX_PROBE_EVENT_SIZE 3072 41 42 42 43 /* Reserved field names */ 43 44 #define FIELD_STRING_IP "__probe_ip" ··· 562 561 C(BAD_TYPE4STR, "This type does not fit for string."),\ 563 562 C(NEED_STRING_TYPE, "$comm and immediate-string only accepts string type"),\ 564 563 C(TOO_MANY_ARGS, "Too many arguments are specified"), \ 565 - C(TOO_MANY_EARGS, "Too many entry arguments specified"), 564 + C(TOO_MANY_EARGS, "Too many entry arguments specified"), \ 565 + C(EVENT_TOO_BIG, "Event too big (too many fields?)"), 566 566 567 567 #undef C 568 568 #define C(a, b) TP_ERR_##a