Skip to content

Commit 2d6c907

Browse files
authored
Merge pull request #904 from lntuition/master
Setup filters properly when options are set using the default option file. There was a annoying message when it's used by the info command. Signed-off-by: Namhyung Kim <namhyung@gmail.com>
2 parents df0921f + a691335 commit 2d6c907

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

cmds/info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ int command_info(int argc, char *argv[], struct opts *opts)
12341234
goto out;
12351235
}
12361236

1237-
fstack_setup_filters(opts, &handle);
1237+
fstack_setup_task(opts->tid, &handle);
12381238
if (opts->show_task) {
12391239
/* ignore errors */
12401240
read_task_txt_file(&handle.sessions, opts->dirname,

utils/fstack.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ static void update_first_timestamp(struct uftrace_data *handle,
140140
}
141141

142142
/**
143-
* setup_task_filter - setup task filters using tid
143+
* fstack_setup_task - setup task filters using tid
144144
* @tid_filter - CSV of tid (or possibly separated by ':')
145145
* @handle - file handle
146146
*
147147
* This function sets up task filters using @tid_filter.
148148
* Tasks not listed will be ignored.
149149
*/
150-
static void setup_task_filter(char *tid_filter, struct uftrace_data *handle)
150+
void fstack_setup_task(char *tid_filter, struct uftrace_data *handle)
151151
{
152152
int i, k;
153153
int nr_filters = 0;
@@ -432,15 +432,15 @@ int fstack_setup_filters(struct opts *opts, struct uftrace_data *handle)
432432
opts->filter ?: "",
433433
(opts->filter && opts->trigger) ? " or " : "",
434434
opts->trigger ?: "",
435-
(opts->filter || opts->trigger) ? " or " : "",
435+
((opts->filter || opts->trigger) && opts->caller) ? " or " : "",
436436
opts->caller ?: "");
437437
}
438438
}
439439

440440
if (opts->disabled)
441441
fstack_enabled = false;
442442

443-
setup_task_filter(opts->tid, handle);
443+
fstack_setup_task(opts->tid, handle);
444444

445445
fstack_prepare_fixup(handle);
446446
return 0;
@@ -2308,7 +2308,7 @@ static int fstack_test_setup_file(struct uftrace_data *handle, int nr_tid)
23082308

23092309
test_tasks[i].tid = handle->info.tids[i];
23102310
}
2311-
setup_task_filter(NULL, handle);
2311+
fstack_setup_task(NULL, handle);
23122312

23132313
/* for fstack_entry not to crash */
23142314
for (i = 0; i < handle->info.nr_tid; i++)

utils/fstack.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ struct uftrace_task_reader *get_task_handle(struct uftrace_data *handle,
105105
int tid);
106106
void reset_task_handle(struct uftrace_data *handle);
107107

108+
void fstack_setup_task(char *tid_filter, struct uftrace_data *handle);
109+
108110
int read_rstack(struct uftrace_data *handle,
109111
struct uftrace_task_reader **task);
110112
int peek_rstack(struct uftrace_data *handle,

0 commit comments

Comments
 (0)