X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-events.h;h=4093bd8abd6a39567bd33213cb33746218c9f3f0;hb=149b9a9d86d7351ee9a44ce391884cc12e922124;hp=aca645459820fe1de4eca570795980c205c67036;hpb=2fa2d39a42f3407edcb0664bf4d04af28837ea2c;p=lttng-modules.git diff --git a/lttng-events.h b/lttng-events.h index aca64545..4093bd8a 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -1,34 +1,22 @@ -#ifndef _LTTNG_EVENTS_H -#define _LTTNG_EVENTS_H - -/* +/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) + * * lttng-events.h * * Holds LTTng per-session event registry. * * Copyright (C) 2010-2012 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; only - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef _LTTNG_EVENTS_H +#define _LTTNG_EVENTS_H + #include #include #include #include #include #include +#include #include #include #include @@ -219,8 +207,12 @@ struct lttng_ctx_field { struct lttng_perf_counter_field *perf_counter; } u; void (*destroy)(struct lttng_ctx_field *field); - /* private data to keep state between get_size and record */ - void *private; + /* + * Private data to keep state between get_size and record. + * User must perform its own synchronization to protect against + * concurrent and reentrant contexts. + */ + void *priv; }; struct lttng_ctx { @@ -318,6 +310,11 @@ struct lttng_event { struct { char *symbol_name; } ftrace; + struct { + struct uprobe_consumer up_consumer; + struct inode *inode; + loff_t offset; + } uprobe; } u; struct list_head list; /* Event list in session */ unsigned int metadata_dumped:1; @@ -780,6 +777,34 @@ void lttng_kprobes_destroy_private(struct lttng_event *event) } #endif +#ifdef CONFIG_UPROBES +int lttng_uprobes_register(const char *name, + const char *path, + uint64_t offset, + struct lttng_event *event); +void lttng_uprobes_unregister(struct lttng_event *event); +void lttng_uprobes_destroy_private(struct lttng_event *event); +#else +static inline +int lttng_uprobes_register(const char *name, + const char *path, + uint64_t offset, + struct lttng_event *event) +{ + return -ENOSYS; +} + +static inline +void lttng_uprobes_unregister(struct lttng_event *event) +{ +} + +static inline +void lttng_uprobes_destroy_private(struct lttng_event *event) +{ +} +#endif + #ifdef CONFIG_KRETPROBES int lttng_kretprobes_register(const char *name, const char *symbol_name,