* @arg: command arg
*
* This ioctl implements lttng commands:
- * LTTNG_SESSION
+ * LTTNG_KERNEL_SESSION
* Returns a LTTng trace session file descriptor
*
* The returned session will be deleted when its file descriptor is closed.
long lttng_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
- case LTTNG_SESSION:
+ case LTTNG_KERNEL_SESSION:
return lttng_abi_create_session();
default:
return -ENOIOCTLCMD;
* We tolerate no failure path after event creation. It will stay
* invariant for the rest of the session.
*/
- event = ltt_event_create(channel, event_name, INSTRUM_TRACEPOINTS,
+ event = ltt_event_create(channel, event_name, LTTNG_KERNEL_TRACEPOINTS,
event_desc, NULL);
if (!event) {
goto create_error;
static
int lttng_abi_create_channel(struct file *session_file,
- struct lttng_channel __user *uchan_param,
+ struct lttng_kernel_channel __user *uchan_param,
enum channel_type channel_type)
{
struct ltt_session *session = session_file->private_data;
const char *transport_name;
struct ltt_channel *chan;
struct file *chan_file;
- struct lttng_channel chan_param;
+ struct lttng_kernel_channel chan_param;
int chan_fd;
int ret = 0;
* @arg: command arg
*
* This ioctl implements lttng commands:
- * LTTNG_CHANNEL
+ * LTTNG_KERNEL_CHANNEL
* Returns a LTTng channel file descriptor
*
* The returned channel will be deleted when its file descriptor is closed.
struct ltt_session *session = file->private_data;
switch (cmd) {
- case LTTNG_CHANNEL:
+ case LTTNG_KERNEL_CHANNEL:
return lttng_abi_create_channel(file,
- (struct lttng_channel __user *)arg,
+ (struct lttng_kernel_channel __user *) arg,
PER_CPU_CHANNEL);
- case LTTNG_SESSION_START:
+ case LTTNG_KERNEL_SESSION_START:
return ltt_session_start(session);
- case LTTNG_SESSION_STOP:
+ case LTTNG_KERNEL_SESSION_STOP:
return ltt_session_stop(session);
- case LTTNG_METADATA:
+ case LTTNG_KERNEL_METADATA:
return lttng_abi_create_channel(file,
- (struct lttng_channel __user *)arg,
+ (struct lttng_kernel_channel __user *) arg,
METADATA_CHANNEL);
default:
return -ENOIOCTLCMD;
static
int lttng_abi_create_event(struct file *channel_file,
- struct lttng_event __user *uevent_param)
+ struct lttng_kernel_event __user *uevent_param)
{
struct ltt_channel *channel = channel_file->private_data;
const struct lttng_event_desc *event_desc;
struct ltt_event *event;
char *event_name;
- struct lttng_event event_param;
+ struct lttng_kernel_event event_param;
int event_fd, ret;
struct file *event_file;
* We tolerate no failure path after event creation. It will stay
* invariant for the rest of the session.
*/
- event = ltt_event_create(channel, event_name, event_param.itype,
+ event = ltt_event_create(channel, event_name, event_param.instrumentation,
event_desc, NULL);
if (!event) {
goto event_error;
* @arg: command arg
*
* This ioctl implements lttng commands:
- * LTTNG_STREAM
+ * LTTNG_KERNEL_STREAM
* Returns an event stream file descriptor or failure.
* (typically, one event stream records events from one CPU)
- * LTTNG_EVENT
+ * LTTNG_KERNEL_EVENT
* Returns an event file descriptor or failure.
*
* Channel and event file descriptors also hold a reference on the session.
long lttng_channel_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
- case LTTNG_STREAM:
+ case LTTNG_KERNEL_STREAM:
return lttng_abi_open_stream(file);
- case LTTNG_EVENT:
- return lttng_abi_create_event(file, (struct lttng_event __user *)arg);
+ case LTTNG_KERNEL_EVENT:
+ return lttng_abi_create_event(file, (struct lttng_kernel_event __user *) arg);
default:
return -ENOIOCTLCMD;
}
* @arg: command arg
*
* This ioctl implements lttng commands:
- * LTTNG_STREAM
+ * LTTNG_KERNEL_STREAM
* Returns an event stream file descriptor or failure.
*
* Channel and event file descriptors also hold a reference on the session.
long lttng_metadata_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
- case LTTNG_STREAM:
+ case LTTNG_KERNEL_STREAM:
return lttng_abi_open_stream(file);
default:
return -ENOIOCTLCMD;
#include <linux/fs.h>
-enum instrum_type {
- INSTRUM_TRACEPOINTS,
+enum lttng_kernel_instrumentation {
+ LTTNG_KERNEL_TRACEPOINTS,
+ LTTNG_KERNEL_KPROBES,
};
/*
* LTTng DebugFS ABI structures.
*/
-struct lttng_channel {
+struct lttng_kernel_channel {
int overwrite; /* 1: overwrite, 0: discard */
u64 subbuf_size;
u64 num_subbuf;
unsigned int read_timer_interval;
};
-struct lttng_event {
- enum instrum_type itype;
+struct lttng_kernel_event {
+ enum lttng_kernel_instrumentation instrumentation;
char name[];
};
-/* TODO: LTTNG_KERNEL_SESSION..... */
-/* TODO: ioctl LTTNG_KERNEL_TRACER_VERSION */
+/*
+ * Either addr is used, or symbol_name and offset.
+ */
+struct lttng_kernel_kprobe {
+ u64 addr;
+
+ u64 offset;
+ char symbol_name[];
+};
-#define LTTNG_SESSION _IO(0xF6, 0x40)
-#define LTTNG_SESSION_START _IO(0xF6, 0x41)
-#define LTTNG_SESSION_STOP _IO(0xF6, 0x42)
-#define LTTNG_CHANNEL _IOW(0xF6, 0x43, struct lttng_channel)
-#define LTTNG_STREAM _IO(0xF6, 0x44)
-#define LTTNG_EVENT _IOW(0xF6, 0x45, struct lttng_event)
-#define LTTNG_METADATA _IOW(0xF6, 0x46, struct lttng_channel)
+#define LTTNG_KERNEL_SESSION _IO(0xF6, 0x40)
+#define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x41)
+#define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x42)
+#define LTTNG_KERNEL_CHANNEL \
+ _IOW(0xF6, 0x43, struct lttng_kernel_channel)
+#define LTTNG_KERNEL_STREAM _IO(0xF6, 0x44)
+#define LTTNG_KERNEL_EVENT \
+ _IOW(0xF6, 0x45, struct lttng_kernel_event)
+#define LTTNG_KERNEL_METADATA \
+ _IOW(0xF6, 0x46, struct lttng_kernel_channel)
+#define LTTNG_KERNEL_KPROBE \
+ _IOW(0xF6, 0x47, struct lttng_kernel_kprobe)
+#define LTTNG_KERNEL_TRACER_VERSION \
+ _IOW(0xF6, 0x48, struct lttng_kernel_tracer_version)
#endif /* _LTT_DEBUGFS_ABI_H */
* Supports event creation while tracing session is active.
*/
struct ltt_event *ltt_event_create(struct ltt_channel *chan, char *name,
- enum instrum_type itype,
+ enum lttng_kernel_instrumentation instrumentation,
const struct lttng_event_desc *event_desc,
void *filter)
{
event->desc = event_desc;
event->filter = filter;
event->id = chan->free_event_id++;
- event->itype = itype;
+ event->instrumentation = instrumentation;
/* Populate ltt_event structure before tracepoint registration. */
smp_wmb();
- switch (itype) {
- case INSTRUM_TRACEPOINTS:
+ switch (instrumentation) {
+ case LTTNG_KERNEL_TRACEPOINTS:
ret = tracepoint_probe_register(name, event_desc->probe_callback,
event);
if (ret)
{
int ret = -EINVAL;
- switch (event->itype) {
- case INSTRUM_TRACEPOINTS:
+ switch (event->instrumentation) {
+ case LTTNG_KERNEL_TRACEPOINTS:
ret = tracepoint_probe_unregister(event->desc->name,
event->desc->probe_callback,
event);