File: main.c

package info (click to toggle)
eztrace 2.0%2Brepack-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,132 kB
  • sloc: ansic: 23,501; perl: 910; sh: 857; cpp: 771; makefile: 696; fortran: 327; f90: 320; python: 57
file content (61 lines) | stat: -rw-r--r-- 1,438 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
 * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis
 * See COPYING in top-level directory.
 */

#include "eztrace.h"
#include "eztrace_sampling.h"


#include "main_ev_codes.h"


int (*libbin_instrumented_function) (double *t, int size, int n);
int (*liblib_instrumented_function) (double *t, int size, int n);



int lib_instrumented_function (double *t, int size, int n) {
    FUNCTION_ENTRY;
    EZTRACE_EVENT_PACKED_1 (EZTRACE_lib_function_1, n);
    int ret = liblib_instrumented_function (t, size, n);
    EZTRACE_EVENT_PACKED_1 (EZTRACE_lib_function_2, n);
    return ret;
}

int bin_instrumented_function (double *t, int size, int n) {
  FUNCTION_ENTRY;
  EZTRACE_EVENT_PACKED_1 (EZTRACE_bin_function_1, n);
  int ret = libbin_instrumented_function (t, size, n);
  EZTRACE_EVENT_PACKED_1 (EZTRACE_bin_function_2, n);
  return ret;
}



START_INTERCEPT
  INTERCEPT2("lib_instrumented_function", liblib_instrumented_function)
INTERCEPT2("bin_instrumented_function", libbin_instrumented_function)
END_INTERCEPT

static void __main_init (void) __attribute__ ((constructor));
/* Initialize the current library */
static void
__main_init (void)
{
  DYNAMIC_INTERCEPT_ALL();

  /* start event recording */
#ifdef EZTRACE_AUTOSTART
  eztrace_start ();
#endif

}

static void __main_conclude (void) __attribute__ ((destructor));
static void
__main_conclude (void)
{
  /* stop event recording */
  eztrace_stop ();
}