Move to kernel style SPDX license identifiers
[lttng-ust.git] / doc / examples / getcpu-override / lttng-ust-getcpu-override-example.c
1 /*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 */
6
7 #include <stdlib.h>
8 #include <time.h>
9 #include <string.h>
10 #include <stdio.h>
11 #include <lttng/ust-getcpu.h>
12
13 static
14 int plugin_getcpu(void)
15 {
16 /* Dummy: always return CPU 0. */
17 return 0;
18 }
19
20 void lttng_ust_getcpu_plugin_init(void)
21 {
22 int ret;
23
24 ret = lttng_ust_getcpu_override(plugin_getcpu);
25 if (ret) {
26 fprintf(stderr, "Error enabling getcpu override: %s\n",
27 strerror(-ret));
28 goto error;
29 }
30 return;
31
32 error:
33 exit(EXIT_FAILURE);
34 }
This page took 0.02918 seconds and 4 git commands to generate.