From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: acme@ghostprotocols.net, Anton Blanchard <anton@au1.ibm.com>,
paulus@samba.org
Cc: linuxppc-dev@ozlabs.org, jolsa@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH] perf: Fix compile warnings in tests/attr.c
Date: Fri, 18 Jan 2013 17:30:52 -0800 [thread overview]
Message-ID: <20130119013052.GA24693@us.ibm.com> (raw)
>From 4d266e5040c33103f5d226b0d16b89f8ef79e3ad Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Date: Fri, 18 Jan 2013 11:14:28 -0800
Subject: [PATCH] perf: Fix compile warnings in tests/attr.c
Replace '%llu' in printf()s with 'PRIu64' in 'tools/perf/tests/attr.c'
to fix compile warnings (which become errors due to -Werror).
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
tools/perf/tests/attr.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index f61dd3f..5cbb2b3 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -65,7 +65,7 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,
FILE *file;
char path[PATH_MAX];
- snprintf(path, PATH_MAX, "%s/event-%d-%llu-%d", dir,
+ snprintf(path, PATH_MAX, "%s/event-%d-%" PRIu64 "-%d", dir,
attr->type, attr->config, fd);
file = fopen(path, "w+");
@@ -74,7 +74,7 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,
return -1;
}
- if (fprintf(file, "[event-%d-%llu-%d]\n",
+ if (fprintf(file, "[event-%d-%" PRIu64 "-%d]\n",
attr->type, attr->config, fd) < 0) {
perror("test attr - failed to write event file");
fclose(file);
@@ -91,10 +91,10 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,
/* struct perf_event_attr */
WRITE_ASS(type, PRIu32);
WRITE_ASS(size, PRIu32);
- WRITE_ASS(config, "llu");
- WRITE_ASS(sample_period, "llu");
- WRITE_ASS(sample_type, "llu");
- WRITE_ASS(read_format, "llu");
+ WRITE_ASS(config, PRIu64);
+ WRITE_ASS(sample_period, PRIu64);
+ WRITE_ASS(sample_type, PRIu64);
+ WRITE_ASS(read_format, PRIu64);
WRITE_ASS(disabled, "d");
WRITE_ASS(inherit, "d");
WRITE_ASS(pinned, "d");
@@ -119,10 +119,10 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,
WRITE_ASS(exclude_callchain_user, "d");
WRITE_ASS(wakeup_events, PRIu32);
WRITE_ASS(bp_type, PRIu32);
- WRITE_ASS(config1, "llu");
- WRITE_ASS(config2, "llu");
- WRITE_ASS(branch_sample_type, "llu");
- WRITE_ASS(sample_regs_user, "llu");
+ WRITE_ASS(config1, PRIu64);
+ WRITE_ASS(config2, PRIu64);
+ WRITE_ASS(branch_sample_type, PRIu64);
+ WRITE_ASS(sample_regs_user, PRIu64);
WRITE_ASS(sample_stack_user, PRIu32);
fclose(file);
--
1.7.1
next reply other threads:[~2013-01-19 1:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-19 1:30 Sukadev Bhattiprolu [this message]
2013-01-21 13:59 ` [PATCH] perf: Fix compile warnings in tests/attr.c Jiri Olsa
2013-01-21 21:38 ` Sukadev Bhattiprolu
2013-01-22 13:57 ` Jiri Olsa
2013-01-22 23:45 ` Michael Ellerman
2013-01-23 18:57 ` Sukadev Bhattiprolu
2013-01-24 2:42 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130119013052.GA24693@us.ibm.com \
--to=sukadev@linux.vnet.ibm.com \
--cc=acme@ghostprotocols.net \
--cc=anton@au1.ibm.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).