Re: [PATCH RFC] hist lookups

David Miller
2018-11-11T22:58:22Z

From: Jiri Olsa <jolsa@redhat.com>
Date: Sun, 11 Nov 2018 23:43:36 +0100

> On Sun, Nov 11, 2018 at 02:32:08PM -0800, David Miller wrote:
>> From: Jiri Olsa <jolsa@redhat.com>
>> Date: Sun, 11 Nov 2018 20:41:32 +0100
>>
>> > I added the dropping logic, it's simple so far..
>>
>> How do you maintain your perf/fixes branch? Do you rebase? :-/
>>
>> I just pulled after a previous pull and got nothing but conflicts on
>> every single file.
>
> yep, I rebase.. it's my devel branch, I dont keep it sane, sry ;-)

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

The iterator variable type changes are because of comparisons between
signed and unsigned.

The rlimit members are long long unsigned int.

Etc.

diff --git a/tools/perf/bench/epoll-ctl.c b/tools/perf/bench/epoll-ctl.c
index b6f6fc4..0128ed8 100644
--- a/tools/perf/bench/epoll-ctl.c
+++ b/tools/perf/bench/epoll-ctl.c
@@ -201,7 +201,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 +302,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 +340,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 %llu to: %llu\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 4e4efc5..d5d17e2 100644
--- a/tools/perf/bench/epoll-wait.c
+++ b/tools/perf/bench/epoll-wait.c
@@ -395,7 +395,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 +459,7 @@ 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 %llu to: %llu\n", prevrl.rlim_max, rl.rlim_max);
if (setrlimit(RLIMIT_NOFILE, &rl) < 0)
err(EXIT_FAILURE, "setrlimit");