Skip to contentSkip to conversation

perf-record: no build id option fails

PATCH In review David Ahern 3 participants 5 messages Feb 6, 2012 – Mar 5, 2012 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf-record: no build id option fails

A recent refactoring of perf-record introduced the following:

perf record -a -B
Couldn't generating buildids. Use --no-buildid to profile anyway.
sleep: Terminated

I believe the triple negative was meant to be only a double negative. :-) While I'm there, fixed the grammar on the error message.

---
 tools/perf/builtin-record.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-record.c +2 -2
index 32870ee..47a0055 100644
@@ -504,9 +504,9 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
 			return err;
 	}
 
-	if (!!rec->no_buildid
+	if (!rec->no_buildid
 	    && !perf_header__has_feat(&session->header, HEADER_BUILD_ID)) {
-		pr_err("Couldn't generating buildids. "
+		pr_err("Couldn't generate buildids. "
 		       "Use --no-buildid to profile anyway.\n");
 		return -1;
 	}
Signature · 1 line
1.7.7.6
#1 lore raw

tools/perf/builtin-record.c static int __cmd_record(struct perf_record *rec, int argc, const char **argv) · line 510

Quoted 12 lines · David Ahern
tools/perf/builtin-record.c +2 -2
@@ -504,9 +504,9 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
 			return err;
 	}
 
-	if (!!rec->no_buildid
+	if (!rec->no_buildid
 	    && !perf_header__has_feat(&session->header, HEADER_BUILD_ID)) {
-		pr_err("Couldn't generating buildids. "
+		pr_err("Couldn't generate buildids. "
 		       "Use --no-buildid to profile anyway.\n");

After this fix it might make sense to do a s/no_buildid/build_id across the source and negate all the conditions. Generally it's cleaner to have no negation in structure field names, it avoids such double and triple negation problems.

The feature bit did it correctly: it has HEADER_BUILD_ID which signals the presence of build-ids.

( Btw., in error messages it might make sense to do a
subsystem-wide s/buildid/build-id rename as well, to make it all easier to read - when I read 'buildid' I often keep wondering who that Buil guy is and what he did. )

Thanks,

Ingo

#2 lore raw

Em Tue, Feb 07, 2012 at 10:06:23AM +0100, Ingo Molnar escreveu:

Quoted 21 lines · David Ahern

tools/perf/builtin-record.c static int __cmd_record(struct perf_record *rec, int argc, const char **argv) · line 510

Quoted 13 lines
tools/perf/builtin-record.c +2 -2
@@ -504,9 +504,9 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
 			return err;
 	}
 
-	if (!!rec->no_buildid
+	if (!rec->no_buildid
 	    && !perf_header__has_feat(&session->header, HEADER_BUILD_ID)) {
-		pr_err("Couldn't generating buildids. "
+		pr_err("Couldn't generate buildids. "
 		       "Use --no-buildid to profile anyway.\n");

After this fix it might make sense to do a s/no_buildid/build_id across the source and negate all the conditions. Generally it's cleaner to have no negation in structure field names, it avoids such double and triple negation problems.

Quoted 7 lines

The feature bit did it correctly: it has HEADER_BUILD_ID which signals the presence of build-ids.

( Btw., in error messages it might make sense to do a
subsystem-wide s/buildid/build-id rename as well, to make it all easier to read - when I read 'buildid' I often keep wondering who that Buil guy is and what he did. )

Yeah, making it consistently build_id (and build-id in command line options) is better than disturbing Buil, as he did nothing to deserve that level of disturbance from these pesky linux guys ;-)

- Arnaldo

#3 lore raw

[tip:perf/core] perf record: No build id option fails

In reply to David Ahern
Commit-ID:  d3665498955779e56453501a16f4ad084f798802
Gitweb:     http://git.kernel.org/tip/d3665498955779e56453501a16f4ad084f798802
Author:     David Ahern <[email protected]>
AuthorDate: Mon, 6 Feb 2012 15:27:52 -0700
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 9 Feb 2012 12:28:10 -0200

perf record: No build id option fails

A recent refactoring of perf-record introduced the following:

perf record -a -B
Couldn't generating buildids. Use --no-buildid to profile anyway.
sleep: Terminated

I believe the triple negative was meant to be only a double negative. :-) While I'm there, fixed the grammar on the error message.

---
 tools/perf/builtin-record.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-record.c +2 -2
index f8d9a54..d6d1c6c 100644
@@ -494,9 +494,9 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
 			return err;
 	}
 
-	if (!!rec->no_buildid
+	if (!rec->no_buildid
 	    && !perf_header__has_feat(&session->header, HEADER_BUILD_ID)) {
-		pr_err("Couldn't generating buildids. "
+		pr_err("Couldn't generate buildids. "
 		       "Use --no-buildid to profile anyway.\n");
 		return -1;
 	}
#4 lore raw

[tip:perf/core] perf record: No build id option fails

In reply to David Ahern
Commit-ID:  6e557a6adfdbb511dbfa7a0a4aa2148f76a01c6d
Gitweb:     http://git.kernel.org/tip/6e557a6adfdbb511dbfa7a0a4aa2148f76a01c6d
Author:     David Ahern <[email protected]>
AuthorDate: Mon, 6 Feb 2012 15:27:52 -0700
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Sat, 3 Mar 2012 11:02:16 -0300

perf record: No build id option fails

A recent refactoring of perf-record introduced the following:

perf record -a -B
Couldn't generating buildids. Use --no-buildid to profile anyway.
sleep: Terminated

I believe the triple negative was meant to be only a double negative. :-) While I'm there, fixed the grammar on the error message.

---
 tools/perf/builtin-record.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-record.c +2 -2
index 0abfb18..39b6a40 100644
@@ -503,9 +503,9 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
 			return err;
 	}
 
-	if (!!rec->no_buildid
+	if (!rec->no_buildid
 	    && !perf_header__has_feat(&session->header, HEADER_BUILD_ID)) {
-		pr_err("Couldn't generating buildids. "
+		pr_err("Couldn't generate buildids. "
 		       "Use --no-buildid to profile anyway.\n");
 		return -1;
 	}