linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf timechart record: fix off-by-one error in argv
@ 2014-03-16 16:06 Ramkumar Ramachandra
  2014-03-17 10:11 ` Stanislav Fomichev
  2014-03-19 13:06 ` [tip:perf/core] perf timechart: Fix off-by-one error in 'record' argv handling tip-bot for Ramkumar Ramachandra
  0 siblings, 2 replies; 3+ messages in thread
From: Ramkumar Ramachandra @ 2014-03-16 16:06 UTC (permalink / raw)
  To: LKML
  Cc: Stanislav Fomichev, Namhyung Kim, David Ahern, Jiri Olsa,
	Arnaldo Carvalho de Melo

Since 367b315 (perf timechart: Add support for -P and -T in timechart
recording, 2013-11-01), the 'perf timechart record' command stopped
working:

  $ perf timechart record -- git status
  Workload failed: No such file or directory

This happens because of an off-by-one error while preparing the argv for
cmd_record(): it attempts to execute the command 'status' and complains
that it doesn't exist. Fix this error.

Cc: Stanislav Fomichev <stfomichev@yandex-team.ru>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 tools/perf/builtin-timechart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 25526d6..d4991a2 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -1238,7 +1238,7 @@ static int timechart__record(struct timechart *tchart, int argc, const char **ar
 	for (i = 0; i < old_power_args_nr; i++)
 		*p++ = strdup(old_power_args[i]);
 
-	for (j = 1; j < (unsigned int)argc; j++)
+	for (j = 0; j < (unsigned int)argc; j++)
 		*p++ = argv[j];
 
 	return cmd_record(rec_argc, rec_argv, NULL);
-- 
1.9.rc0.1.g9d22d25


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf timechart record: fix off-by-one error in argv
  2014-03-16 16:06 [PATCH] perf timechart record: fix off-by-one error in argv Ramkumar Ramachandra
@ 2014-03-17 10:11 ` Stanislav Fomichev
  2014-03-19 13:06 ` [tip:perf/core] perf timechart: Fix off-by-one error in 'record' argv handling tip-bot for Ramkumar Ramachandra
  1 sibling, 0 replies; 3+ messages in thread
From: Stanislav Fomichev @ 2014-03-17 10:11 UTC (permalink / raw)
  To: Ramkumar Ramachandra
  Cc: LKML, Namhyung Kim, David Ahern, Jiri Olsa, Arnaldo Carvalho de Melo

On Sun, Mar 16, 2014 at 12:06:05PM -0400, Ramkumar Ramachandra wrote:
> Since 367b315 (perf timechart: Add support for -P and -T in timechart
> recording, 2013-11-01), the 'perf timechart record' command stopped
> working:
> 
>   $ perf timechart record -- git status
>   Workload failed: No such file or directory
> 
> This happens because of an off-by-one error while preparing the argv for
> cmd_record(): it attempts to execute the command 'status' and complains
> that it doesn't exist. Fix this error.
> 
> Cc: Stanislav Fomichev <stfomichev@yandex-team.ru>
Thanks. I probably never actually tested it with the command :-\

Acked-by: Stanislav Fomichev <stfomichev@yandex-team.ru>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf timechart: Fix off-by-one error in 'record' argv handling
  2014-03-16 16:06 [PATCH] perf timechart record: fix off-by-one error in argv Ramkumar Ramachandra
  2014-03-17 10:11 ` Stanislav Fomichev
@ 2014-03-19 13:06 ` tip-bot for Ramkumar Ramachandra
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Ramkumar Ramachandra @ 2014-03-19 13:06 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, hpa, mingo, namhyung, jolsa, stfomichev,
	dsahern, tglx, artagnon

Commit-ID:  263f89bf7d0f5ba98077dda8df1ff814862ad5ba
Gitweb:     http://git.kernel.org/tip/263f89bf7d0f5ba98077dda8df1ff814862ad5ba
Author:     Ramkumar Ramachandra <artagnon@gmail.com>
AuthorDate: Sun, 16 Mar 2014 12:06:05 -0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 18 Mar 2014 18:16:47 -0300

perf timechart: Fix off-by-one error in 'record' argv handling

Since 367b315 (perf timechart: Add support for -P and -T in timechart
recording, 2013-11-01), the 'perf timechart record' command stopped
working:

  $ perf timechart record -- git status
  Workload failed: No such file or directory

This happens because of an off-by-one error while preparing the argv for
cmd_record(): it attempts to execute the command 'status' and complains
that it doesn't exist. Fix this error.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Acked-by: Stanislav Fomichev <stfomichev@yandex-team.ru>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stanislav Fomichev <stfomichev@yandex-team.ru>
Link: http://lkml.kernel.org/r/1394985965-2332-1-git-send-email-artagnon@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-timechart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 25526d6..d4991a2 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -1238,7 +1238,7 @@ static int timechart__record(struct timechart *tchart, int argc, const char **ar
 	for (i = 0; i < old_power_args_nr; i++)
 		*p++ = strdup(old_power_args[i]);
 
-	for (j = 1; j < (unsigned int)argc; j++)
+	for (j = 0; j < (unsigned int)argc; j++)
 		*p++ = argv[j];
 
 	return cmd_record(rec_argc, rec_argv, NULL);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-19 13:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-16 16:06 [PATCH] perf timechart record: fix off-by-one error in argv Ramkumar Ramachandra
2014-03-17 10:11 ` Stanislav Fomichev
2014-03-19 13:06 ` [tip:perf/core] perf timechart: Fix off-by-one error in 'record' argv handling tip-bot for Ramkumar Ramachandra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).