lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 19 Mar 2014 06:06:27 -0700
From:	tip-bot for Ramkumar Ramachandra <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	acme@...hat.com, linux-kernel@...r.kernel.org, hpa@...or.com,
	mingo@...nel.org, namhyung@...nel.org, jolsa@...hat.com,
	stfomichev@...dex-team.ru, dsahern@...il.com, tglx@...utronix.de,
	artagnon@...il.com
Subject: [tip:perf/core] perf timechart: Fix off-by-one error in 'record'
  argv handling

Commit-ID:  263f89bf7d0f5ba98077dda8df1ff814862ad5ba
Gitweb:     http://git.kernel.org/tip/263f89bf7d0f5ba98077dda8df1ff814862ad5ba
Author:     Ramkumar Ramachandra <artagnon@...il.com>
AuthorDate: Sun, 16 Mar 2014 12:06:05 -0400
Committer:  Arnaldo Carvalho de Melo <acme@...hat.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@...il.com>
Acked-by: Stanislav Fomichev <stfomichev@...dex-team.ru>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Stanislav Fomichev <stfomichev@...dex-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@...hat.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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists