Debian Codegraph @

test/pptrace/comparison/instrument/libinstrument-dummy/instrument.c

raw
1 /* -*- c-file-style: "GNU" -*- */
2 /*
3 * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis
4 * See COPYING in top-level directory.
5 */
6
7 #include <stdint.h>
8 #include <stdio.h>
9 #include "instrument.h"
10
11 static uint64_t nb_events = 0;
12
13 void record_event0(uint64_t code) {
14 //printf("record_event0\n");
15 nb_events++;
16 }
17
18 void record_event1(uint64_t code, uint64_t arg1) {
19 nb_events++;
20 }
21
22 void record_event2(uint64_t code, uint64_t arg1, uint64_t arg2) {
23 nb_events++;
24 }
25
26 void record_event3(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3) {
27 nb_events++;
28 }
29
30 void record_event4(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3,
31 uint64_t arg4) {
32 nb_events++;
33 }
34
35 void record_event5(uint64_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3,
36 uint64_t arg4, uint64_t arg5) {
37 nb_events++;
38 }
39
40 void __init(void) __attribute__ ((constructor));
41 void __init(void) {
42 fprintf(stderr, "Starting instrument-dummy...\n");
43 }
44
45 void __conclude(void) __attribute__ ((destructor));
46 void __conclude(void) {
47 fprintf(stderr, "Stopping instrument-dummy...\n");
48 fprintf(stderr, "\t%ld events\n", nb_events);
49 }