Skip to content

Commit 3019913

Browse files
mhiramatrostedt
authored andcommitted
tracing/dynevent: Pass extra arguments to match operation
Pass extra arguments to match operation for checking exact match. If the event doesn't support exact match, it will be ignored. Link: http://lkml.kernel.org/r/156095685930.28024.10405547027475590975.stgit@devnote2 Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent cb8e7a8 commit 3019913

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

kernel/trace/trace_dynevent.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ int dyn_event_release(int argc, char **argv, struct dyn_event_operations *type)
4747
return -EINVAL;
4848
event++;
4949
}
50+
argc--; argv++;
5051

5152
p = strchr(event, '/');
5253
if (p) {
@@ -61,7 +62,8 @@ int dyn_event_release(int argc, char **argv, struct dyn_event_operations *type)
6162
for_each_dyn_event_safe(pos, n) {
6263
if (type && type != pos->ops)
6364
continue;
64-
if (!pos->ops->match(system, event, pos))
65+
if (!pos->ops->match(system, event,
66+
argc, (const char **)argv, pos))
6567
continue;
6668

6769
ret = pos->ops->free(pos);

kernel/trace/trace_dynevent.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ struct dyn_event;
3131
* @is_busy: Check whether given event is busy so that it can not be deleted.
3232
* Return true if it is busy, otherwides false.
3333
* @free: Delete the given event. Return 0 if success, otherwides error.
34-
* @match: Check whether given event and system name match this event.
35-
* Return true if it matches, otherwides false.
34+
* @match: Check whether given event and system name match this event. The argc
35+
* and argv is used for exact match. Return true if it matches, otherwides
36+
* false.
3637
*
3738
* Except for @create, these methods are called under holding event_mutex.
3839
*/
@@ -43,7 +44,7 @@ struct dyn_event_operations {
4344
bool (*is_busy)(struct dyn_event *ev);
4445
int (*free)(struct dyn_event *ev);
4546
bool (*match)(const char *system, const char *event,
46-
struct dyn_event *ev);
47+
int argc, const char **argv, struct dyn_event *ev);
4748
};
4849

4950
/* Register new dyn_event type -- must be called at first */

kernel/trace/trace_events_hist.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ static int synth_event_show(struct seq_file *m, struct dyn_event *ev);
374374
static int synth_event_release(struct dyn_event *ev);
375375
static bool synth_event_is_busy(struct dyn_event *ev);
376376
static bool synth_event_match(const char *system, const char *event,
377-
struct dyn_event *ev);
377+
int argc, const char **argv, struct dyn_event *ev);
378378

379379
static struct dyn_event_operations synth_event_ops = {
380380
.create = synth_event_create,
@@ -422,7 +422,7 @@ static bool synth_event_is_busy(struct dyn_event *ev)
422422
}
423423

424424
static bool synth_event_match(const char *system, const char *event,
425-
struct dyn_event *ev)
425+
int argc, const char **argv, struct dyn_event *ev)
426426
{
427427
struct synth_event *sev = to_synth_event(ev);
428428

kernel/trace/trace_kprobe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static int trace_kprobe_show(struct seq_file *m, struct dyn_event *ev);
3939
static int trace_kprobe_release(struct dyn_event *ev);
4040
static bool trace_kprobe_is_busy(struct dyn_event *ev);
4141
static bool trace_kprobe_match(const char *system, const char *event,
42-
struct dyn_event *ev);
42+
int argc, const char **argv, struct dyn_event *ev);
4343

4444
static struct dyn_event_operations trace_kprobe_ops = {
4545
.create = trace_kprobe_create,
@@ -138,7 +138,7 @@ static bool trace_kprobe_is_busy(struct dyn_event *ev)
138138
}
139139

140140
static bool trace_kprobe_match(const char *system, const char *event,
141-
struct dyn_event *ev)
141+
int argc, const char **argv, struct dyn_event *ev)
142142
{
143143
struct trace_kprobe *tk = to_trace_kprobe(ev);
144144

kernel/trace/trace_uprobe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static int trace_uprobe_show(struct seq_file *m, struct dyn_event *ev);
4444
static int trace_uprobe_release(struct dyn_event *ev);
4545
static bool trace_uprobe_is_busy(struct dyn_event *ev);
4646
static bool trace_uprobe_match(const char *system, const char *event,
47-
struct dyn_event *ev);
47+
int argc, const char **argv, struct dyn_event *ev);
4848

4949
static struct dyn_event_operations trace_uprobe_ops = {
5050
.create = trace_uprobe_create,
@@ -285,7 +285,7 @@ static bool trace_uprobe_is_busy(struct dyn_event *ev)
285285
}
286286

287287
static bool trace_uprobe_match(const char *system, const char *event,
288-
struct dyn_event *ev)
288+
int argc, const char **argv, struct dyn_event *ev)
289289
{
290290
struct trace_uprobe *tu = to_trace_uprobe(ev);
291291

0 commit comments

Comments
 (0)