Commit 263f89bf7d0f5ba98077dda8df1ff814862ad5ba

Authored by Ramkumar Ramachandra
Committed by Arnaldo Carvalho de Melo
1 parent 0afd2d5102

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

tools/perf/builtin-timechart.c
... ... @@ -1238,7 +1238,7 @@
1238 1238 for (i = 0; i < old_power_args_nr; i++)
1239 1239 *p++ = strdup(old_power_args[i]);
1240 1240  
1241   - for (j = 1; j < (unsigned int)argc; j++)
  1241 + for (j = 0; j < (unsigned int)argc; j++)
1242 1242 *p++ = argv[j];
1243 1243  
1244 1244 return cmd_record(rec_argc, rec_argv, NULL);