Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eab8bcb6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'perf-tools-for-linus' of git://github.com/acmel/linux

* 'perf-tools-for-linus' of git://github.com/acmel/linux:
  perf tools: Add support for disabling -Werror via WERROR=0
  perf top: Fix userspace sample addr map offset
  perf symbols: Fix issue with binaries using 16-bytes buildids (v2)
  perf tool: Fix endianness handling of u32 data in samples
  perf sort: Fix symbol sort output by separating unresolved samples by type
  perf symbols: Synthesize anonymous mmap events
  perf record: Create events initially disabled and enable after init
  perf symbols: Add some heuristics for choosing the best duplicate symbol
  perf symbols: Preserve symbol scope when parsing /proc/kallsyms
  perf symbols: /proc/kallsyms does not sort module symbols
  perf symbols: Fix ppc64 SEGV in dso__load_sym with debuginfo files
  perf probe: Fix regression of variable finder
parents f35f3dc4 9e59e099
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@ endif
# Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
#
# Define NO_DWARF if you do not want debug-info analysis feature at all.
#
# Define WERROR=0 to disable treating any warnings as errors.

$(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
	@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
@@ -63,6 +65,11 @@ ifeq ($(ARCH),x86_64)
	endif
endif

# Treat warnings as errors unless directed not to
ifneq ($(WERROR),0)
	CFLAGS_WERROR := -Werror
endif

#
# Include saner warnings here, which can catch bugs:
#
@@ -95,7 +102,7 @@ ifndef PERF_DEBUG
  CFLAGS_OPTIMIZE = -O6
endif

CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
EXTLIBS = -lpthread -lrt -lelf -lm
ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
ALL_LDFLAGS = $(LDFLAGS)
+3 −0
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@ static void config_attr(struct perf_evsel *evsel, struct perf_evlist *evlist)
	struct perf_event_attr *attr = &evsel->attr;
	int track = !evsel->idx; /* only the first counter needs these */

	attr->disabled		= 1;
	attr->inherit		= !no_inherit;
	attr->read_format	= PERF_FORMAT_TOTAL_TIME_ENABLED |
				  PERF_FORMAT_TOTAL_TIME_RUNNING |
@@ -671,6 +672,8 @@ static int __cmd_record(int argc, const char **argv)
		}
	}

	perf_evlist__enable(evsel_list);

	/*
	 * Let the child rip
	 */
+1 −1
Original line number Diff line number Diff line
@@ -561,7 +561,7 @@ static int test__basic_mmap(void)
		}

		err = perf_event__parse_sample(event, attr.sample_type, sample_size,
					       false, &sample);
					       false, &sample, false);
		if (err) {
			pr_err("Can't parse sample, err = %d\n", err);
			goto out_munmap;
+5 −4
Original line number Diff line number Diff line
@@ -191,7 +191,8 @@ static void __zero_source_counters(struct sym_entry *syme)
	symbol__annotate_zero_histograms(sym);
}

static void record_precise_ip(struct sym_entry *syme, int counter, u64 ip)
static void record_precise_ip(struct sym_entry *syme, struct map *map,
			      int counter, u64 ip)
{
	struct annotation *notes;
	struct symbol *sym;
@@ -205,8 +206,8 @@ static void record_precise_ip(struct sym_entry *syme, int counter, u64 ip)
	if (pthread_mutex_trylock(&notes->lock))
		return;

	ip = syme->map->map_ip(syme->map, ip);
	symbol__inc_addr_samples(sym, syme->map, counter, ip);
	ip = map->map_ip(map, ip);
	symbol__inc_addr_samples(sym, map, counter, ip);

	pthread_mutex_unlock(&notes->lock);
}
@@ -810,7 +811,7 @@ static void perf_event__process_sample(const union perf_event *event,
		evsel = perf_evlist__id2evsel(top.evlist, sample->id);
		assert(evsel != NULL);
		syme->count[evsel->idx]++;
		record_precise_ip(syme, evsel->idx, ip);
		record_precise_ip(syme, al.map, evsel->idx, ip);
		pthread_mutex_lock(&top.active_symbols_lock);
		if (list_empty(&syme->node) || !syme->node.next) {
			static bool first = true;
+5 −0
Original line number Diff line number Diff line
@@ -169,12 +169,17 @@ static int perf_event__synthesize_mmap_events(union perf_event *event,
			continue;
		pbf += n + 3;
		if (*pbf == 'x') { /* vm_exec */
			char anonstr[] = "//anon\n";
			char *execname = strchr(bf, '/');

			/* Catch VDSO */
			if (execname == NULL)
				execname = strstr(bf, "[vdso]");

			/* Catch anonymous mmaps */
			if ((execname == NULL) && !strstr(bf, "["))
				execname = anonstr;

			if (execname == NULL)
				continue;

Loading