4eb512d4e79ab29e5973973f656492dfa90d562b
1 #ifndef _LTT_CHANNELS_H
2 #define _LTT_CHANNELS_H
5 * Copyright (C) 2008 Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca)
7 * Dynamic tracer channel allocation.
10 #include <linux/limits.h>
11 //ust// #include <linux/kref.h>
12 //ust// #include <linux/list.h>
15 #include "kernelcompat.h"
18 #define EVENTS_PER_CHANNEL 65536
20 struct ltt_trace_struct
;
23 struct ltt_channel_struct
{
24 /* First 32 bytes cache-hot cacheline */
25 struct ltt_trace_struct
*trace
;
27 void *trans_channel_data
;
30 unsigned int n_subbufs_order
;
31 unsigned long commit_count_mask
; /*
32 * Commit count mask, removing
33 * the MSBs corresponding to
34 * bits used to represent the
37 /* End of first 32 bytes cacheline */
40 * buffer_begin - called on buffer-switch to a new sub-buffer
41 * @buf: the channel buffer containing the new sub-buffer
43 void (*buffer_begin
) (struct rchan_buf
*buf
,
44 u64 tsc
, unsigned int subbuf_idx
);
46 * buffer_end - called on buffer-switch to a new sub-buffer
47 * @buf: the channel buffer containing the previous sub-buffer
49 void (*buffer_end
) (struct rchan_buf
*buf
,
50 u64 tsc
, unsigned int offset
, unsigned int subbuf_idx
);
51 struct kref kref
; /* Channel transport reference count */
52 unsigned int subbuf_size
;
53 unsigned int subbuf_cnt
;
54 const char *channel_name
;
57 } ____cacheline_aligned
;
59 struct ltt_channel_setting
{
60 unsigned int subbuf_size
;
61 unsigned int subbuf_cnt
;
62 struct kref kref
; /* Number of references to structure content */
63 struct list_head list
;
64 unsigned int index
; /* index of channel in trace channel array */
65 u16 free_event_id
; /* Next event ID to allocate */
69 int ltt_channels_register(const char *name
);
70 int ltt_channels_unregister(const char *name
);
71 int ltt_channels_set_default(const char *name
,
72 unsigned int subbuf_size
,
73 unsigned int subbuf_cnt
);
74 const char *ltt_channels_get_name_from_index(unsigned int index
);
75 int ltt_channels_get_index_from_name(const char *name
);
76 struct ltt_channel_struct
*ltt_channels_trace_alloc(unsigned int *nr_channels
,
79 void ltt_channels_trace_free(struct ltt_channel_struct
*channels
);
80 int _ltt_channels_get_event_id(const char *channel
, const char *name
);
81 int ltt_channels_get_event_id(const char *channel
, const char *name
);
83 #endif /* _LTT_CHANNELS_H */
This page took 0.030084 seconds and 3 git commands to generate.