login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
August
»
12
Re: [PATCH] perf trace: get rid of the hard-coded paths in the report scripts
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Stephane Eranian
Subject:
Re: [PATCH] perf trace: get rid of the hard-coded paths in the report scripts
Date: Thursday, August 12, 2010 - 2:28 pm
On Thu, Aug 12, 2010 at 7:59 PM, Tom Zanussi <tzanussi@gmail.com> wrote:
quoted text
> The perf trace report shell scripts hard-code the exec path of the > scripts into their command-lines, which doesn't work if perf has been > installed somewhere else. > > Instead, perf trace should create the paths at run-time. This patch > does that and removes the hard-coded paths from all the report scripts. > > v2 changes: The first version inadvertantly caused scripts run from > outside the perf exec path to fail e.g. 'perf trace -s test.py'. The > fix is to try the script name without the exec path first, then the > version using the exec path, which restores the expected behavior. > > Reported-by: Stephane Eranian <eranian@google.com> > Signed-off-by: Tom Zanussi <tzanussi@gmail.com> > --- > tools/perf/builtin-trace.c | 22 ++++++++++++++++--- > tools/perf/scripts/perl/bin/failed-syscalls-report | 2 +- > tools/perf/scripts/perl/bin/rw-by-file-report | 2 +- > tools/perf/scripts/perl/bin/rw-by-pid-report | 2 +- > tools/perf/scripts/perl/bin/rwtop-report | 2 +- > tools/perf/scripts/perl/bin/wakeup-latency-report | 2 +- > tools/perf/scripts/perl/bin/workqueue-stats-report | 2 +- > .../python/bin/failed-syscalls-by-pid-report | 2 +- > .../perf/scripts/python/bin/sched-migration-report | 2 +- > tools/perf/scripts/python/bin/sctop-report | 2 +- > .../python/bin/syscall-counts-by-pid-report | 2 +- > .../perf/scripts/python/bin/syscall-counts-report | 3 +- > 12 files changed, 30 insertions(+), 15 deletions(-) > > diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c > index 40a6a29..88a1883 100644 > --- a/tools/perf/builtin-trace.c > +++ b/tools/perf/builtin-trace.c > @@ -573,6 +573,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used) > const char *suffix = NULL; > const char **__argv; > char *script_path; > + struct stat perf_stat; > int i, err; > > if (argc >= 2 && strncmp(argv[1], "rec", strlen("rec")) == 0) { > @@ -689,8 +690,6 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used) > return -EINVAL; > > if (generate_script_lang) { > - struct stat perf_stat; > - > int input = open(input_name, O_RDONLY); > if (input < 0) { > perror("failed to open file"); > @@ -719,10 +718,25 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used) > } > > if (script_name) { > - err = scripting_ops->start_script(script_name, argc, argv); > + char script_exec_path[MAXPATHLEN]; > + > + snprintf(script_exec_path, MAXPATHLEN, "%s", script_name); > + err = stat(script_exec_path, &perf_stat);
Why not simply use access() instead of stat() here?
quoted text
> + if (err < 0) { > + snprintf(script_exec_path, MAXPATHLEN, "%s/scripts/%s", > + perf_exec_path(), script_name); > + err = stat(script_exec_path, &perf_stat);
And here? --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] perf trace: get rid of the hard-coded paths in the ...
, Tom Zanussi
, (Thu Aug 12, 10:59 am)
Re: [PATCH] perf trace: get rid of the hard-coded paths in ...
, Arnaldo Carvalho de Melo
, (Thu Aug 12, 11:20 am)
Re: [PATCH] perf trace: get rid of the hard-coded paths in ...
, Stephane Eranian
, (Thu Aug 12, 2:28 pm)
Re: [PATCH] perf trace: get rid of the hard-coded paths in ...
, Stephane Eranian
, (Thu Aug 12, 2:29 pm)
Re: [PATCH] perf trace: get rid of the hard-coded paths in ...
, Tom Zanussi
, (Thu Aug 12, 2:50 pm)
Re: [PATCH] perf trace: get rid of the hard-coded paths in ...
, Stephane Eranian
, (Fri Aug 13, 1:30 am)
Re: [PATCH] perf trace: get rid of the hard-coded paths in ...
, Tom Zanussi
, (Fri Aug 13, 9:38 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Fortier,Vincent [Montreal]
2.6.21.5 june 30th to july 1st date hang?
Jeff Dike
[ PATCH 2/6 ] UML - Formatting fixes around os_{read_write}_file callers
Liam Girdwood
[PATCH 07/13] regulator: regulator test harness
Oleg Nesterov
Re: Getting the new RxRPC patches upstream
Stefan Seyfried
Re: 2.6.19-rc5: grub is much slower resuming from suspend-to-disk than in 2.6.18
linux-netdev
:
Arnaud Ebalard
Re: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0
Jan Engelhardt
Re: [PATCH iptables] extension: add xt_cpu match
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Sebastian Andrzej Siewior
[PATCH 8/8] net/emergency: remove locking from reycling pool if emergncy pools are...
David Miller
Re: [PATCH] qlcnic: dont assume NET_IP_ALIGN is 2
git
:
Jakub Narebski
Re: git on MacOSX and files with decomposed utf-8 file names
Brandon Casey
Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the def...
Christian Couder
[PATCH 1/3] rev-parse: add test script for "--verify"
Ramkumar Ramachandra
Re: [GSoC update] git-remote-svn: The final one
Junio C Hamano
Re: git-rm isn't the inverse action of git-add
openbsd-misc
:
Joachim Schipper
Re: UVC Webcams
Florin Andrei
SOLVED [was: firewall is very slow, something's wrong]
Todd Alan Smith
Re: Microsoft gets the Most Secure Operating Systems award
Neal Hogan
Re: Need Advice: Thinkpad T60 or T61?
Sam Fourman Jr.
Re: Real men don't attack straw men
git-commits-head
:
Linux Kernel Mailing List
ACPI: Disable ARB_DISABLE on platforms where it is not needed
Linux Kernel Mailing List
m68knommu: add read_barrier_depends() and irqs_disabled_flags()
Linux Kernel Mailing List
[MTD] Add mtd panic_write function pointer
Linux Kernel Mailing List
[ARM] pxa: remove duplicate select statements from Kconfig
Linux Kernel Mailing List
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
Colocation donated by:
Syndicate