Skip to content

perf tools: Fix incorrect fd error comparison

Adrian Hunter lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 of 2 patches 1 replyIn review

1 of 2 patches is in this archive. The cover letter announces 2.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2perf tools: Fix incorrect fd error comparisontools/perf/util/dso.c+1 -11 reply

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchJiri Olsa
1/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] perf tools: Fix incorrect fd error comparison
Quoted 10 lines · Adrian Hunter
Quoted 8 lines

Add 'data_status' to record whether a dso has data (i.e. an object file) as follows:

	dso->data_status	meaning
	----------------------------------
	0			don't know
	-1			no data
	1			has data

please add enum for this

Ok

Quoted 17 lines
Quoted 17 lines
---
 tools/perf/util/dso.c | 5 ++++-
 tools/perf/util/dso.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
tools/perf/util/dso.c +0 -1
index fc006fe..91a4eb4 100644
@@ -556,8 +556,11 @@ static ssize_t data_read_offset(struct dso *dso, u64 offset,
 ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine,
 			      u64 offset, u8 *data, ssize_t size)
 {
-	if (dso__data_fd(dso, machine) < 0)
Quoted 8 lines

tools/perf/util/dso.c static ssize_t data_read_offset(struct dso *dso, u64 offset, · line 563

Quoted 5 lines
tools/perf/util/dso.c +4 -0
+	if (dso__data_fd(dso, machine) < 0) {
+		dso->data.data_status = -1;
 		return -1;
+	}
+	dso->data.data_status = 1;

we have more callers to dso__data_fd, so I think we want to setup dso->data.data_status within dso__data_fd

Ok. Here are 2 patches because I noticed another thing.

Adrian Hunter (2):
perf tools: Fix incorrect fd error comparison perf tools: Record whether a dso has data

 tools/perf/util/dso.c | 27 +++++++++++++++++----------
 tools/perf/util/dso.h |  7 +++++++
 2 files changed, 24 insertions(+), 10 deletions(-)