projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tracepoint API change: rename TP_ARGS to TP_VARS
[lttng-ust.git]
/
tests
/
benchmark
/
bench.c
diff --git
a/tests/benchmark/bench.c
b/tests/benchmark/bench.c
index ec08130d764e8d5001a7836ab45ec470fa5b1fd1..ce476f9bd996c4b3ac2859c3b669c084db7e7dec 100644
(file)
--- a/
tests/benchmark/bench.c
+++ b/
tests/benchmark/bench.c
@@
-11,27
+11,25
@@
#include <unistd.h>
#include <sched.h>
#include <ust/marker.h>
#include <unistd.h>
#include <sched.h>
#include <ust/marker.h>
+#include <time.h>
static int nr_cpus;
static unsigned long nr_events;
static int nr_cpus;
static unsigned long nr_events;
-pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
void do_stuff(void)
{
int v;
FILE *file;
void do_stuff(void)
{
int v;
FILE *file;
- int lock;
v = 1;
v = 1;
- lock = pthread_mutex_lock(&mutex);
- file = fopen("/tmp/bench.txt", "a");
+ file = fopen("/dev/null", "a");
fprintf(file, "%d", v);
fclose(file);
fprintf(file, "%d", v);
fclose(file);
-
lock = pthread_mutex_unlock(&mutex
);
+
time(NULL
);
#ifdef MARKER
#ifdef MARKER
-
trace_mark(ust,
event, "event %d", v);
+
ust_marker(
event, "event %d", v);
#endif
}
#endif
}
@@
-47,7
+45,6
@@
void *function(void *arg)
return NULL;
}
return NULL;
}
-
void usage(char **argv) {
printf("Usage: %s nr_cpus nr_events\n", argv[0]);
}
void usage(char **argv) {
printf("Usage: %s nr_cpus nr_events\n", argv[0]);
}
This page took
0.023774 seconds
and
4
git commands to generate.