lttd spaces to tabs
[ltt-control.git] / ltt-control / liblttctl / lttctl.h
CommitLineData
2727692a 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#include <asm/types.h>
27#include <sys/socket.h>
28#include <linux/netlink.h>
29
30#ifndef NETLINK_LTT
31#define NETLINK_LTT 31
32#endif
33
34
35enum trace_op {
36 OP_CREATE,
37 OP_DESTROY,
38 OP_START,
39 OP_STOP,
40 OP_NONE
41};
42
43enum trace_mode {
44 LTT_TRACE_NORMAL,
45 LTT_TRACE_FLIGHT
46};
47
48typedef struct lttctl_peer_msg {
49 char trace_name[NAME_MAX];
9f46b64c 50 char trace_type[NAME_MAX];
2727692a 51 enum trace_op op;
52 union {
53 struct {
54 enum trace_mode mode;
55 unsigned subbuf_size;
56 unsigned n_subbufs;
57 } new_trace;
58 } args;
59} lttctl_peer_msg_t;
60
61
62struct lttctl_handle
63{
64 int fd;
65 //u_int8_t blocking;
66 struct sockaddr_nl local;
67 struct sockaddr_nl peer;
68};
69
70typedef struct lttctl_resp_msg {
71 int err;
72} lttctl_resp_msg_t;
73
74struct lttctl_handle *lttctl_create_handle(void);
75
76int lttctl_destroy_handle(struct lttctl_handle *h);
77
78
79int lttctl_create_trace(const struct lttctl_handle *h,
9f46b64c 80 char *name, enum trace_mode mode, char *trace_type, unsigned subbuf_size, unsigned n_subbufs);
2727692a 81
82int lttctl_destroy_trace(const struct lttctl_handle *handle, char *name);
83
84int lttctl_start(const struct lttctl_handle *handle, char *name);
85
86int lttctl_stop(const struct lttctl_handle *handle, char *name);
87
88#define LTTCTLM_BASE 0x10
89#define LTTCTLM_CONTROL (LTTCTLM_BASE + 1) /* LTT control message */
90
91
92#endif //_LIBLTT_H
This page took 0.026176 seconds and 4 git commands to generate.