Skip to content

Commit b9fb2de

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-urgent-for-mingo-5.5-20191223' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: perf report/top: Arnaldo Carvalho de Melo: - Fix popup menu for entries in main kernel maps other than the main one, e.g. ".init.text", where a non-initialized pointer was causing segfaults. Jin Yao: - Fix incorrectly added dimensions when switching perf.data file to another via the popup menu. libtraceevent: Hewenliang: - Fix memory leakage in filter_event(). perf hists: Yuya Fujita: - Fix variable name's inconsistency in hists__for_each() macro. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2 parents 46cf053 + 55347ec commit b9fb2de

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

tools/lib/traceevent/parse-filter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,8 +1228,10 @@ filter_event(struct tep_event_filter *filter, struct tep_event *event,
12281228
}
12291229

12301230
filter_type = add_filter_type(filter, event->id);
1231-
if (filter_type == NULL)
1231+
if (filter_type == NULL) {
1232+
free_arg(arg);
12321233
return TEP_ERRNO__MEM_ALLOC_FAILED;
1234+
}
12331235

12341236
if (filter_type->filter)
12351237
free_arg(filter_type->filter);

tools/perf/builtin-report.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,7 @@ int cmd_report(int argc, const char **argv)
10761076
struct stat st;
10771077
bool has_br_stack = false;
10781078
int branch_mode = -1;
1079+
int last_key = 0;
10791080
bool branch_call_mode = false;
10801081
#define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function,percent"
10811082
static const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n"
@@ -1450,7 +1451,8 @@ int cmd_report(int argc, const char **argv)
14501451
sort_order = sort_tmp;
14511452
}
14521453

1453-
if (setup_sorting(session->evlist) < 0) {
1454+
if ((last_key != K_SWITCH_INPUT_DATA) &&
1455+
(setup_sorting(session->evlist) < 0)) {
14541456
if (sort_order)
14551457
parse_options_usage(report_usage, options, "s", 1);
14561458
if (field_order)
@@ -1530,6 +1532,7 @@ int cmd_report(int argc, const char **argv)
15301532
ret = __cmd_report(&report);
15311533
if (ret == K_SWITCH_INPUT_DATA) {
15321534
perf_session__delete(session);
1535+
last_key = K_SWITCH_INPUT_DATA;
15331536
goto repeat;
15341537
} else
15351538
ret = 0;

tools/perf/util/hist.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,10 @@ static inline void perf_hpp__prepend_sort_field(struct perf_hpp_fmt *format)
339339
list_for_each_entry_safe(format, tmp, &(_list)->sorts, sort_list)
340340

341341
#define hists__for_each_format(hists, format) \
342-
perf_hpp_list__for_each_format((hists)->hpp_list, fmt)
342+
perf_hpp_list__for_each_format((hists)->hpp_list, format)
343343

344344
#define hists__for_each_sort_list(hists, format) \
345-
perf_hpp_list__for_each_sort_list((hists)->hpp_list, fmt)
345+
perf_hpp_list__for_each_sort_list((hists)->hpp_list, format)
346346

347347
extern struct perf_hpp_fmt perf_hpp__format[];
348348

tools/perf/util/symbol-elf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,9 @@ static int dso__process_kernel_symbol(struct dso *dso, struct map *map,
920920
if (curr_map == NULL)
921921
return -1;
922922

923+
if (curr_dso->kernel)
924+
map__kmap(curr_map)->kmaps = kmaps;
925+
923926
if (adjust_kernel_syms) {
924927
curr_map->start = shdr->sh_addr + ref_reloc(kmap);
925928
curr_map->end = curr_map->start + shdr->sh_size;

0 commit comments

Comments
 (0)