~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
progs/perftest.c: Use from Glibc syscall numbers.
[catacomb]
/
progs
/
perftest.c
diff --git
a/progs/perftest.c
b/progs/perftest.c
index
6af4d51
..
7c4a133
100644
(file)
--- a/
progs/perftest.c
+++ b/
progs/perftest.c
@@
-44,13
+44,14
@@
#include <unistd.h>
#ifdef HAVE_LINUX_PERF_EVENT_H
#include <unistd.h>
#ifdef HAVE_LINUX_PERF_EVENT_H
+# include <sys/syscall.h>
# include <linux/perf_event.h>
# include <linux/perf_event.h>
-# include <asm/unistd.h>
#endif
#include <mLib/alloc.h>
#include <mLib/bits.h>
#include <mLib/dstr.h>
#endif
#include <mLib/alloc.h>
#include <mLib/bits.h>
#include <mLib/dstr.h>
+#include <mLib/macros.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
#include <mLib/report.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
#include <mLib/report.h>
@@
-797,7
+798,7
@@
static void init_cyclecount(void)
attr.exclude_kernel = 1;
attr.exclude_hv = 1;
attr.exclude_kernel = 1;
attr.exclude_hv = 1;
- if ((perf_fd = syscall(
__NR
_perf_event_open, &attr, 0, -1, -1, 0)) < 0)
+ if ((perf_fd = syscall(
SYS
_perf_event_open, &attr, 0, -1, -1, 0)) < 0)
moan("failed to open perf event: %s", strerror(errno));
else
cyclecount_active_p = 1;
moan("failed to open perf event: %s", strerror(errno));
else
cyclecount_active_p = 1;
@@
-979,7
+980,7
@@
int main(int argc, char *argv[])
if (optind + 1 != argc) { usage(stderr); exit(1); }
for (j = jobtab; j->name; j++)
if (optind + 1 != argc) { usage(stderr); exit(1); }
for (j = jobtab; j->name; j++)
- if (
strcmp(j->name, argv[optind]) == 0
) break;
+ if (
STRCMP(j->name, ==, argv[optind])
) break;
if (!j->name) die(1, "unknown job type `%s'", argv[optind]);
p = j->init(&o);
if (!j->name) die(1, "unknown job type `%s'", argv[optind]);
p = j->init(&o);