lkml.org 
[lkml]   [2018]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 01/12] perf tools: Fix build on sparc
Date
From: David Miller <davem@davemloft.net>

A lot of warnings on sparc, this is the patch I'm using.

Cc: Davidlohr Bueso <dave@stgolabs.net>
Link: http://lkml.kernel.org/n/tip-xfdgbruww1yfr42eygcm186b@git.kernel.org
Signed-off-by: David Miller <davem@davemloft.net>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/bench/epoll-ctl.c | 7 ++++---
tools/perf/bench/epoll-wait.c | 6 ++++--
2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/tools/perf/bench/epoll-ctl.c b/tools/perf/bench/epoll-ctl.c
index b6f6fc4a7129..5b6ecfcc8c3a 100644
--- a/tools/perf/bench/epoll-ctl.c
+++ b/tools/perf/bench/epoll-ctl.c
@@ -19,6 +19,7 @@
#include <sys/resource.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
+#include <inttypes.h>

#include "../util/stat.h"
#include <subcmd/parse-options.h>
@@ -201,7 +202,7 @@ static void *workerfn(void *arg)

static void init_fdmaps(struct worker *w, int pct)
{
- ssize_t i;
+ unsigned int i;
int inc;
struct epoll_event ev;

@@ -302,7 +303,7 @@ int bench_epoll_ctl(int argc, const char **argv)
struct worker *worker = NULL;
struct cpu_map *cpu;
struct rlimit rl, prevrl;
- ssize_t i;
+ unsigned int i;

argc = parse_options(argc, argv, options, bench_epoll_ctl_usage, 0);
if (argc) {
@@ -340,7 +341,7 @@ int bench_epoll_ctl(int argc, const char **argv)
if (getrlimit(RLIMIT_NOFILE, &prevrl))
err(EXIT_FAILURE, "getrlimit");
rl.rlim_cur = rl.rlim_max = nfds * nthreads * 2 + 50;
- printinfo("Setting RLIMIT_NOFILE rlimit from %lu to: %lu\n",
+ printinfo("Setting RLIMIT_NOFILE rlimit from %" PRIu64 " to: %" PRIu64 "\n",
prevrl.rlim_max, rl.rlim_max);
if (setrlimit(RLIMIT_NOFILE, &rl) < 0)
err(EXIT_FAILURE, "setrlimit");
diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c
index 4e4efc5cfe22..595e9833201b 100644
--- a/tools/perf/bench/epoll-wait.c
+++ b/tools/perf/bench/epoll-wait.c
@@ -73,6 +73,7 @@
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <sys/types.h>
+#include <inttypes.h>

#include "../util/stat.h"
#include <subcmd/parse-options.h>
@@ -395,7 +396,7 @@ static void *writerfn(void *p)
nanosleep(&ts, NULL);
}

- printinfo("exiting writer-thread (total full-loops: %ld)\n", iter);
+ printinfo("exiting writer-thread (total full-loops: %ld)\n", (long int) iter);
return NULL;
}

@@ -459,7 +460,8 @@ int bench_epoll_wait(int argc, const char **argv)
if (getrlimit(RLIMIT_NOFILE, &prevrl))
err(EXIT_FAILURE, "getrlimit");
rl.rlim_cur = rl.rlim_max = nfds * nthreads * 2 + 50;
- printinfo("Setting RLIMIT_NOFILE rlimit from %lu to: %lu\n", prevrl.rlim_max, rl.rlim_max);
+ printinfo("Setting RLIMIT_NOFILE rlimit from %" PRIu64 " to: %" PRIu64" \n",
+ prevrl.rlim_max, rl.rlim_max);
if (setrlimit(RLIMIT_NOFILE, &rl) < 0)
err(EXIT_FAILURE, "setrlimit");

--
2.17.2
\
 
 \ /
  Last update: 2018-11-19 13:22    [W:0.147 / U:4.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site