2 * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 * Copyright (C) 2020 Jonathan Rajotte-Julien <jonathan.rajotte-julein@efficios.com>
5 * SPDX-License-Identifier: MIT
8 #include "performance.h"
10 #include <lttng/tracepoint.h>
12 #include <lttng/condition/event-rule.h>
13 #include <lttng/lttng.h>
25 int main(int argc
, char **argv
)
31 struct timespec sleep_time
;
32 struct timespec sleep_rm
;
35 fprintf(stderr
, "Missing unique_id\n");
36 fprintf(stderr
, "Missing number of event \n");
37 fprintf(stderr
, "Missing delay between event in ms \n");
38 fprintf(stderr
, "Usage: producer id bn_event delay_ms\n");
44 nb_hit
= atoi(argv
[2]);
45 sleep_ms
= atoll(argv
[3]);
47 sleep_time
.tv_sec
= sleep_ms
/ 1000;
48 sleep_time
.tv_nsec
= (sleep_ms
% 1000) * 1000000;
50 for (int i
= 0; i
< nb_hit
; i
++) {
51 tracepoint(performance
, hit
, 0, i
);
52 nanosleep(&sleep_time
, &sleep_rm
);
This page took 0.033045 seconds and 5 git commands to generate.