Skip to content

Commit a222455

Browse files
mhiramatrostedt
authored andcommitted
tracing/fprobe: Remove nr_maxactive from fprobe
Remove depercated fprobe::nr_maxactive. This involves fprobe events to rejects the maxactive number. Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com> Cc: Florent Revest <revest@chromium.org> Cc: Martin KaFai Lau <martin.lau@linux.dev> Cc: bpf <bpf@vger.kernel.org> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Alan Maguire <alan.maguire@oracle.com> Cc: Mark Rutland <mark.rutland@arm.com> Link: https://lore.kernel.org/173519007257.391279.946804046982289337.stgit@devnote2 Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent b5fa903 commit a222455

File tree

2 files changed

+6
-39
lines changed

2 files changed

+6
-39
lines changed

include/linux/fprobe.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ struct fprobe_hlist {
5454
* @nmissed: The counter for missing events.
5555
* @flags: The status flag.
5656
* @entry_data_size: The private data storage size.
57-
* @nr_maxactive: The max number of active functions. (*deprecated)
5857
* @entry_handler: The callback function for function entry.
5958
* @exit_handler: The callback function for function exit.
6059
* @hlist_array: The fprobe_hlist for fprobe search from IP hash table.
@@ -63,7 +62,6 @@ struct fprobe {
6362
unsigned long nmissed;
6463
unsigned int flags;
6564
size_t entry_data_size;
66-
int nr_maxactive;
6765

6866
fprobe_entry_cb entry_handler;
6967
fprobe_exit_cb exit_handler;

kernel/trace/trace_fprobe.c

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ static struct trace_fprobe *alloc_trace_fprobe(const char *group,
424424
const char *symbol,
425425
struct tracepoint *tpoint,
426426
struct module *mod,
427-
int maxactive,
428427
int nargs, bool is_return)
429428
{
430429
struct trace_fprobe *tf;
@@ -445,7 +444,6 @@ static struct trace_fprobe *alloc_trace_fprobe(const char *group,
445444

446445
tf->tpoint = tpoint;
447446
tf->mod = mod;
448-
tf->fp.nr_maxactive = maxactive;
449447

450448
ret = trace_probe_init(&tf->tp, event, group, false, nargs);
451449
if (ret < 0)
@@ -1098,12 +1096,11 @@ static int __trace_fprobe_create(int argc, const char *argv[])
10981096
* FETCHARG:TYPE : use TYPE instead of unsigned long.
10991097
*/
11001098
struct trace_fprobe *tf = NULL;
1101-
int i, len, new_argc = 0, ret = 0;
1099+
int i, new_argc = 0, ret = 0;
11021100
bool is_return = false;
11031101
char *symbol = NULL;
11041102
const char *event = NULL, *group = FPROBE_EVENT_SYSTEM;
11051103
const char **new_argv = NULL;
1106-
int maxactive = 0;
11071104
char buf[MAX_EVENT_NAME_LEN];
11081105
char gbuf[MAX_EVENT_NAME_LEN];
11091106
char sbuf[KSYM_NAME_LEN];
@@ -1126,33 +1123,13 @@ static int __trace_fprobe_create(int argc, const char *argv[])
11261123

11271124
trace_probe_log_init("trace_fprobe", argc, argv);
11281125

1129-
event = strchr(&argv[0][1], ':');
1130-
if (event)
1131-
event++;
1132-
1133-
if (isdigit(argv[0][1])) {
1134-
if (event)
1135-
len = event - &argv[0][1] - 1;
1136-
else
1137-
len = strlen(&argv[0][1]);
1138-
if (len > MAX_EVENT_NAME_LEN - 1) {
1139-
trace_probe_log_err(1, BAD_MAXACT);
1140-
goto parse_error;
1141-
}
1142-
memcpy(buf, &argv[0][1], len);
1143-
buf[len] = '\0';
1144-
ret = kstrtouint(buf, 0, &maxactive);
1145-
if (ret || !maxactive) {
1126+
if (argv[0][1] != '\0') {
1127+
if (argv[0][1] != ':') {
1128+
trace_probe_log_set_index(0);
11461129
trace_probe_log_err(1, BAD_MAXACT);
11471130
goto parse_error;
11481131
}
1149-
/* fprobe rethook instances are iterated over via a list. The
1150-
* maximum should stay reasonable.
1151-
*/
1152-
if (maxactive > RETHOOK_MAXACTIVE_MAX) {
1153-
trace_probe_log_err(1, MAXACT_TOO_BIG);
1154-
goto parse_error;
1155-
}
1132+
event = &argv[0][2];
11561133
}
11571134

11581135
trace_probe_log_set_index(1);
@@ -1162,12 +1139,6 @@ static int __trace_fprobe_create(int argc, const char *argv[])
11621139
if (ret < 0)
11631140
goto parse_error;
11641141

1165-
if (!is_return && maxactive) {
1166-
trace_probe_log_set_index(0);
1167-
trace_probe_log_err(1, BAD_MAXACT_TYPE);
1168-
goto parse_error;
1169-
}
1170-
11711142
trace_probe_log_set_index(0);
11721143
if (event) {
11731144
ret = traceprobe_parse_event_name(&event, &group, gbuf,
@@ -1235,7 +1206,7 @@ static int __trace_fprobe_create(int argc, const char *argv[])
12351206

12361207
/* setup a probe */
12371208
tf = alloc_trace_fprobe(group, event, symbol, tpoint, tp_mod,
1238-
maxactive, argc, is_return);
1209+
argc, is_return);
12391210
if (IS_ERR(tf)) {
12401211
ret = PTR_ERR(tf);
12411212
/* This must return -ENOMEM, else there is a bug */
@@ -1315,8 +1286,6 @@ static int trace_fprobe_show(struct seq_file *m, struct dyn_event *ev)
13151286
seq_putc(m, 't');
13161287
else
13171288
seq_putc(m, 'f');
1318-
if (trace_fprobe_is_return(tf) && tf->fp.nr_maxactive)
1319-
seq_printf(m, "%d", tf->fp.nr_maxactive);
13201289
seq_printf(m, ":%s/%s", trace_probe_group_name(&tf->tp),
13211290
trace_probe_name(&tf->tp));
13221291

0 commit comments

Comments
 (0)