diff options
| author | Ingo Molnar <[email protected]> | 2018-03-09 08:27:55 +0100 | 
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2018-03-09 08:27:55 +0100 | 
| commit | fbf8a1e12c3ba3afdf0804bc80f5f13dfec1cffe (patch) | |
| tree | 6b0dd23c7646cd4ec13b0636cdda11188d6845a3 /tools/perf/builtin-c2c.c | |
| parent | 1af22eba248efe2de25658041a80a3d40fb3e92e (diff) | |
| parent | 2427b432e63b4b911100f717c48289195b7a7d62 (diff) | |
Merge tag 'perf-core-for-mingo-4.17-20180308' 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:
- Support to display the IPC/Cycle in 'annotate' TUI, for systems
  where this info can be obtained, like Intel's >= Skylake (Jin Yao)
- Support wildcards on PMU name in dynamic PMU events (Agustin Vega-Frias)
- Display pmu name when printing unmerged events in stat (Agustin Vega-Frias)
- Auto-merge PMU events created by prefix or glob match (Agustin Vega-Frias)
- Fix s390 'call' operations target function annotation (Thomas Richter)
- Handle s390 PC relative load and store instruction in the augmented
  'annotate', code, used so far in the TUI modes of 'perf report' and
  'perf annotate' (Thomas Richter)
- Provide libtraceevent with a kernel symbol resolver, so that
  symbols in tracepoint fields can be resolved when showing them in
  tools such as 'perf report' (Wang YanQing)
- Refactor the cgroups code to look more like other code in tools/perf,
  using cgroup__{put,get} for refcount operations instead of its
  open-coded equivalent, breaking larger functions, etc (Arnaldo Carvalho de Melo)
- Implement support for the -G/--cgroup target in 'perf trace', allowing
  strace like tracing (plus other events, backtraces, etc) for cgroups
  (Arnaldo Carvalho de Melo)
- Update thread shortname in 'perf sched map' when the thread's COMM
  changes (Changbin Du)
- refcount 'struct mem_info', for better sharing it over several
  users, avoid duplicating structs and fixing crashes related to
  use after free (Jiri Olsa)
- Display perf.data version, offsets in 'perf report --header' (Jiri Olsa)
- Record the machine's memory topology information in a perf.data
  feature section, to be used by tools such as 'perf c2c' (Jiri Olsa)
- Fix output of forced groups in the header for 'perf report' --stdio
  and --tui (Jiri Olsa)
- Better support llvm, clang, cxx make tests in the build process (Jiri Olsa)
- Streamline the 'struct perf_mmap' methods, storing some info in the
  struct instead of passing it via various methods, shortening its
  signatures (Kan Liang)
- Update the quipper perf.data parser library site information (Stephane Eranian)
- Correct perf's man pages title markers for asciidoctor (Takashi Iwai)
- Intel PT fixes and refactorings paving the way for implementing
  support for AUX area sampling (Adrian Hunter)
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/perf/builtin-c2c.c')
| -rw-r--r-- | tools/perf/builtin-c2c.c | 24 | 
1 files changed, 11 insertions, 13 deletions
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 539c3d460158..98d243fa0c06 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -237,9 +237,12 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,  	if (mi == NULL)  		return -ENOMEM; -	mi_dup = memdup(mi, sizeof(*mi)); -	if (!mi_dup) -		goto free_mi; +	/* +	 * The mi object is released in hists__add_entry_ops, +	 * if it gets sorted out into existing data, so we need +	 * to take the copy now. +	 */ +	mi_dup = mem_info__get(mi);  	c2c_decode_stats(&stats, mi); @@ -247,7 +250,7 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,  				  &al, NULL, NULL, mi,  				  sample, true);  	if (he == NULL) -		goto free_mi_dup; +		goto free_mi;  	c2c_he = container_of(he, struct c2c_hist_entry, he);  	c2c_add_stats(&c2c_he->stats, &stats); @@ -272,19 +275,15 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,  		mi = mi_dup; -		mi_dup = memdup(mi, sizeof(*mi)); -		if (!mi_dup) -			goto free_mi; -  		c2c_hists = he__get_c2c_hists(he, c2c.cl_sort, 2);  		if (!c2c_hists) -			goto free_mi_dup; +			goto free_mi;  		he = hists__add_entry_ops(&c2c_hists->hists, &c2c_entry_ops,  					  &al, NULL, NULL, mi,  					  sample, true);  		if (he == NULL) -			goto free_mi_dup; +			goto free_mi;  		c2c_he = container_of(he, struct c2c_hist_entry, he);  		c2c_add_stats(&c2c_he->stats, &stats); @@ -303,10 +302,9 @@ out:  	addr_location__put(&al);  	return ret; -free_mi_dup: -	free(mi_dup);  free_mi: -	free(mi); +	mem_info__put(mi_dup); +	mem_info__put(mi);  	ret = -ENOMEM;  	goto out;  }  |