31d2c6b0 |
1 | /* libltt header file |
2 | * |
3 | * Copyright 2005- |
4 | * Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> |
5 | * |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation; either version 2 of the License, or |
10 | * (at your option) any later version. |
11 | * |
12 | * This program is distributed in the hope that it will be useful, |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * GNU General Public License for more details. |
16 | * |
17 | * |
18 | * Inspired from iptables, by James Morris <jmorris@intercode.com.au>. |
19 | * |
20 | */ |
21 | |
22 | #ifndef _LIBLTT_H |
23 | #define _LIBLTT_H |
24 | |
25 | #include <linux/limits.h> |
26 | |
27 | enum trace_op { |
28 | OP_CREATE, |
29 | OP_DESTROY, |
30 | OP_START, |
31 | OP_STOP |
32 | }; |
33 | |
34 | enum trace_mode { |
35 | TRACE_NORMAL, |
36 | TRACE_FLIGHT |
37 | }; |
38 | |
39 | |
40 | struct lttctl_handle |
41 | { |
42 | int fd; |
43 | u_int8_t blocking; |
44 | struct sockaddr_nl local; |
45 | struct sockaddr_nl peer; |
46 | }; |
47 | |
48 | typedef struct lttctl_peer_msg { |
49 | char trace_name[NAME_MAX]; |
50 | enum trace_op op; |
51 | union { |
52 | enum trace_mode mode; |
53 | } args; |
54 | } lttctl_peer_msg_t; |
55 | |
56 | |
57 | struct lttctl_handle *lttctl_create_handle(u_int32_t flags); |
58 | |
59 | int lttctl_destroy_handle(struct lttctl_handle *h); |
60 | |
61 | |
62 | int lttctl_create_trace(char *name, enum trace_mode mode); |
63 | |
64 | int lttctl_destroy_trace(char *name); |
65 | |
66 | int lttctl_start(char *name); |
67 | |
68 | int lttctl_stop(char *name); |
69 | |
70 | #define LTTCTLM_BASE 0x10 |
71 | #define LTTCTLM_CONTROL (LTTCTLM_BASE + 1) /* LTT control message */ |
72 | |
73 | |
74 | #endif //_LIBLTT_H |