perf/urgent fixes
Subsystems (2)
Arnaldo Carvalho de Melo
maintainerHi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit ebf2d2689de551d90965090bb991fc640a0c0d41:
perf/x86: Fix copy_from_user_nmi() return if range is not ok (2015-07-06 14:09:27 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo
for you to fetch changes up to 08ae217b8d44986062fe3648c5bb83816d5bc00f:
perf thread_map: Fix the sizeof() calculation for map entries (2015-07-09 12:28:53 -0300)
----------------------------------------------------------------
perf/urgent fixes:
User visible:
- Fix 'perf top -u username', where not enough memory per thread_map entry was being allocated nor was being initialized, causing a segfault (Arnaldo Carvalho de Melo)
- Fix locking lockup using 32-bit compat vdso (Adrian Hunter)
Developer stuff:
- Fix shadow declaration of close with older build environments (Jiri Olsa)
- Make the 'clean' target do a better job, removing some more temp files (Riku Voipio)
----------------------------------------------------------------
Adrian Hunter (1):
perf tools: Fix lockup using 32-bit compat vdso
Arnaldo Carvalho de Melo (1):
perf thread_map: Fix the sizeof() calculation for map entries
Jiri Olsa (1):
perf stat: Fix shadow declaration of close
Riku Voipio (1):
tools lib: Improve clean target
tools/lib/api/Makefile | 2 +- tools/lib/traceevent/Makefile | 2 +- tools/perf/builtin-stat.c | 4 ++-- tools/perf/util/thread_map.c | 3 +-- tools/perf/util/vdso.c | 8 +++----- 5 files changed, 8 insertions(+), 11 deletions(-)
Arnaldo Carvalho de Melo
maintainerPATCH 1/4 perf tools: Fix lockup using 32-bit compat vdso
From: Adrian Hunter <[email protected]>
The __machine__findnew_compat() function is called only from __machine__findnew_vdso_compat() which is called only from machine__findnew_vdso() which already holds machine->dsos.lock, so remove locking from __machine__findnew_compat().
This manifests itself tracing 32-bit programs with a 64-bit perf.
--- tools/perf/util/vdso.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
tools/perf/util/vdso.c +3 -5
@@ -236,18 +236,16 @@ static struct dso *__machine__findnew_compat(struct machine *machine,const char *file_name;struct dso *dso; -pthread_rwlock_wrlock (&machine->dsos.lock); dso =__dsos__find (&machine->dsos, vdso_file->dso_name, true);if (dso) - goto out_unlock; + goto out; file_name =vdso__get_compat_file (vdso_file);if (!file_name) - goto out_unlock; + goto out; dso =__machine__addnew_vdso (machine, vdso_file->dso_name, file_name); -out_unlock: -pthread_rwlock_unlock (&machine->dsos.lock); +out:return dso; }
Signature · 1 line
2.1.0
Arnaldo Carvalho de Melo
maintainerPATCH 2/4 perf stat: Fix shadow declaration of close
In reply to Arnaldo Carvalho de MeloFrom: Jiri Olsa <[email protected]>
Vinson reported shadow declaration of close introduced by the following commit:
106a94a0f8c2 perf stat: Introduce read_counters function
Using close_counters name instead.
--- tools/perf/builtin-stat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-stat.c +2 -2
@@ -343,7 +343,7 @@ static int read_counter(struct perf_evsel *counter)return 0 ; } -static void read_counters (bool close) +static void read_counters (bool close_counters) {struct perf_evsel *counter;
@@ -354,7 +354,7 @@ static void read_counters(bool close)if (process_counter (counter))pr_warning ("failed to process counter %s\n" , counter->name); -if (close) { +if (close_counters) {perf_evsel__close_fd (counter,perf_evsel__nr_cpus (counter),thread_map__nr (evsel_list->threads)); }
Signature · 1 line
2.1.0
Arnaldo Carvalho de Melo
maintainerPATCH 3/4 tools lib: Improve clean target
In reply to Arnaldo Carvalho de MeloFrom: Riku Voipio <[email protected]>
The clean targets miss some .cmd and .d files.
--- tools/lib/api/Makefile | 2 +- tools/lib/traceevent/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/lib/api/Makefile +1 -1
@@ -36,7 +36,7 @@ $(LIBFILE): $(API_IN) clean: $(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \ - find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM) + find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) FORCE:
tools/lib/traceevent/Makefile +1 -1
@@ -268,7 +268,7 @@ install: install_lib clean: $(call QUIET_CLEAN, libtraceevent) \ - $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d \ + $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd \ $(RM) TRACEEVENT-CFLAGS tags TAGS PHONY += force plugins
Signature · 1 line
2.1.0
Arnaldo Carvalho de Melo
maintainerPATCH 4/4 perf thread_map: Fix the sizeof() calculation for map entries
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
When we started adding extra stuff per array entry, growing the size of those entries to more than sizeof(pid_t), we had to convert those sizeof operations to the more robust sizeof(map->map[0]) idiom, that is future proof, i.e. if/when we add more stuff to those entries, that expression will produce the new per-entry size.
And besides that, we need to zero out those extra fields, that sometimes may not get filled, like when we couldn't care less about the comms, since we don't need those, but since we will try freeing it at thread_map__delete(), we better fix it.
That is why a thread_map__realloc() was provided.
But that method wasn't used in thread_map__new_by_uid(), fix it.
--- tools/perf/util/thread_map.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/perf/util/thread_map.c +1 -2
@@ -136,8 +136,7 @@ struct thread_map *thread_map__new_by_uid(uid_t uid)if (grow) {struct thread_map *tmp; - tmp =realloc (threads, (sizeof (*threads) + - max_threads *sizeof (pid_t))); + tmp =thread_map__realloc (threads, max_threads);if (tmp ==NULL ) goto out_free_namelist;
Signature · 1 line
2.1.0
Quoted 51 lines · Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit
ebf2d2689de551d90965090bb991fc640a0c0d41:perf/x86: Fix
copy_from_user_nmi()return if range is not ok (2015-07-06 14:09:27 +0200)are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.gittags/perf-urgent-for-mingofor you to fetch changes up to
08ae217b8d44986062fe3648c5bb83816d5bc00f:perf
thread_map: Fix thesizeof()calculation for map entries (2015-07-09 12:28:53 -0300)----------------------------------------------------------------
perf/urgent fixes:User visible:
- Fix 'perf top -u username', where not enough memory per
thread_mapentry was being allocated nor was being initialized, causing a segfault (Arnaldo Carvalho de Melo)- Fix locking lockup using 32-bit compat vdso (Adrian Hunter)
Developer stuff:
- Fix shadow declaration of close with older build environments (Jiri Olsa)
- Make the 'clean' target do a better job, removing some more temp files (Riku Voipio)
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>----------------------------------------------------------------
Adrian Hunter (1):
perf tools: Fix lockup using 32-bit compat vdsoArnaldo Carvalho de Melo (1):
perfthread_map: Fix thesizeof()calculation for map entriesJiri Olsa (1):
perf stat: Fix shadow declaration of closeRiku Voipio (1):
tools lib: Improve clean target
Quoted 6 lines
tools/lib/api/Makefile | 2 +- tools/lib/traceevent/Makefile | 2 +- tools/perf/builtin-stat.c | 4 ++-- tools/perf/util/thread_map.c | 3 +-- tools/perf/util/vdso.c | 8 +++----- 5 files changed, 8 insertions(+), 11 deletions(-)
Pulled this and the second round of fixes, thanks a lot Arnaldo!
Ingo