update doc
[lttv.git] / ltt / branches / poly / libltt / libltt.h
CommitLineData
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>
994ef399 26#include <asm/types.h>
94fe07f4 27#include <sys/socket.h>
ace0e68d 28#include <linux/netlink.h>
29
30#ifndef NETLINK_LTT
31#define NETLINK_LTT 12
32#endif
33
31d2c6b0 34
35enum trace_op {
36 OP_CREATE,
37 OP_DESTROY,
38 OP_START,
ace0e68d 39 OP_STOP,
fde1a29a 40 OP_ALIGN,
ace0e68d 41 OP_NONE
31d2c6b0 42};
43
44enum trace_mode {
ace0e68d 45 LTT_TRACE_NORMAL,
46 LTT_TRACE_FLIGHT
31d2c6b0 47};
48
fde1a29a 49typedef struct lttctl_peer_msg {
50 char trace_name[NAME_MAX];
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 unsigned alignment;
59 } args;
60} lttctl_peer_msg_t;
61
31d2c6b0 62
63struct lttctl_handle
64{
65 int fd;
ace0e68d 66 //u_int8_t blocking;
31d2c6b0 67 struct sockaddr_nl local;
68 struct sockaddr_nl peer;
69};
70
ace0e68d 71typedef struct lttctl_resp_msg {
72 int err;
73} lttctl_resp_msg_t;
31d2c6b0 74
ace0e68d 75struct lttctl_handle *lttctl_create_handle(void);
31d2c6b0 76
77int lttctl_destroy_handle(struct lttctl_handle *h);
78
79
fde1a29a 80int lttctl_create_trace(const struct lttctl_handle *h,
81 char *name, enum trace_mode mode, unsigned subbuf_size, unsigned n_subbufs);
31d2c6b0 82
ace0e68d 83int lttctl_destroy_trace(const struct lttctl_handle *handle, char *name);
31d2c6b0 84
ace0e68d 85int lttctl_start(const struct lttctl_handle *handle, char *name);
31d2c6b0 86
ace0e68d 87int lttctl_stop(const struct lttctl_handle *handle, char *name);
31d2c6b0 88
89#define LTTCTLM_BASE 0x10
90#define LTTCTLM_CONTROL (LTTCTLM_BASE + 1) /* LTT control message */
91
92
93#endif //_LIBLTT_H
This page took 0.02896 seconds and 4 git commands to generate.