Commit b0aeb45b authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo-5.5-20191112' of...

Merge tag 'perf-core-for-mingo-5.5-20191112' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

perf record:

  Ravi Bangoria:

  - Provide an option to print perf_event_open args and syscall return value.
    This was already possible using -v, but then lots of other debug info
    would be output as well, provide a way to show just the syscall args
    and return value, e.g.:

      # perf --debug perf-event-open=1 record
      perf_event_attr:
        size                             112
        { sample_period, sample_freq }   4000
        sample_type                      IP|TID|TIME|PERIOD
        read_format                      ID
        disabled                         1
        inherit                          1
      <SNIP>
        ksymbol                          1
        bpf_event                        1
      ------------------------------------------------------------
      sys_perf_event_open: pid 4308  cpu 0  group_fd -1  flags 0x8 = 4

core:

- Remove map->groups, we can get that information in other ways, reduces
  the size of a key data structure and paves the way to have it shared
  by multiple threads.

- Use 'struct map_symbol' in more places, where we already were using a
  'struct map' + 'struct symbol', this helps passing that usual pair of
  information across callchain, browser code, etc.

- Add 'struct map_groups' (where the map_symbol->map is) to 'struct map_symbol',
  to ease annotation code, for instance, where we call from functions in one map
  we're browsing to functions in another DSO, mapped in another 'struct map'.

event parsing:

  Ian Rogers:

  - Use YYABORT to clear stack after failure, plugging leaks

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 295c52ee e1e9b78d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ OPTIONS
	  data-convert     - data convert command debug messages
	  stderr           - write debug output (option -v) to stderr
	                     in browser mode
	  perf-event-open  - Print perf_event_open() arguments and
			     return value

--buildid-dir::
	Setup buildid cache directory. It has higher priority than
+4 −4
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ static int s390_call__parse(struct arch *arch, struct ins_operands *ops,
	char *endptr, *tok, *name;
	struct map *map = ms->map;
	struct addr_map_symbol target = {
		.map = map,
		.ms = { .map = map, },
	};

	tok = strchr(ops->raw, ',');
@@ -38,9 +38,9 @@ static int s390_call__parse(struct arch *arch, struct ins_operands *ops,
		return -1;
	target.addr = map__objdump_2mem(map, ops->target.addr);

	if (map_groups__find_ams(&target) == 0 &&
	    map__rip_2objdump(target.map, map->map_ip(target.map, target.addr)) == ops->target.addr)
		ops->target.sym = target.sym;
	if (map_groups__find_ams(ms->mg, &target) == 0 &&
	    map__rip_2objdump(target.ms.map, map->map_ip(target.ms.map, target.addr)) == ops->target.addr)
		ops->target.sym = target.ms.sym;

	return 0;
}
+3 −3
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ static void process_basic_block(struct addr_map_symbol *start,
				struct addr_map_symbol *end,
				struct branch_flags *flags)
{
	struct symbol *sym = start->sym;
	struct symbol *sym = start->ms.sym;
	struct annotation *notes = sym ? symbol__annotation(sym) : NULL;
	struct block_range_iter iter;
	struct block_range *entry;
@@ -301,9 +301,9 @@ static int hist_entry__tty_annotate(struct hist_entry *he,
				    struct perf_annotate *ann)
{
	if (!ann->use_stdio2)
		return symbol__tty_annotate(he->ms.sym, he->ms.map, evsel, &ann->opts);
		return symbol__tty_annotate(&he->ms, evsel, &ann->opts);

	return symbol__tty_annotate2(he->ms.sym, he->ms.map, evsel, &ann->opts);
	return symbol__tty_annotate2(&he->ms, evsel, &ann->opts);
}

static void hists__find_annotations(struct hists *hists,
+2 −2
Original line number Diff line number Diff line
@@ -412,8 +412,8 @@ static u64 find_callsite(struct evsel *evsel, struct perf_sample *sample)
				 sizeof(key), callcmp);
		if (!caller) {
			/* found */
			if (node->map)
				addr = map__unmap_ip(node->map, node->ip);
			if (node->ms.map)
				addr = map__unmap_ip(node->ms.map, node->ip);
			else
				addr = node->ip;

+1 −1
Original line number Diff line number Diff line
@@ -680,7 +680,7 @@ static int hists__resort_cb(struct hist_entry *he, void *arg)
	if (rep->symbol_ipc && sym && !sym->annotate2) {
		struct evsel *evsel = hists_to_evsel(he->hists);

		symbol__annotate2(sym, he->ms.map, evsel,
		symbol__annotate2(&he->ms, evsel,
				  &annotation__default_options, NULL);
	}

Loading