| 1 | #ifndef _UST_PROBE_H |
| 2 | #define _UST_PROBE_H |
| 3 | |
| 4 | /* |
| 5 | * Copyright (C) 2009 Pierre-Marc Fournier |
| 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2.1 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This library 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 GNU |
| 15 | * Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public |
| 18 | * License along with this library; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | /* Maximum number of callbacks per marker */ |
| 24 | #define LTT_NR_CALLBACKS 10 |
| 25 | |
| 26 | struct ltt_serialize_closure; |
| 27 | struct ust_buffer; |
| 28 | |
| 29 | typedef size_t (*ltt_serialize_cb)(struct ust_buffer *buf, size_t buf_offset, |
| 30 | struct ltt_serialize_closure *closure, |
| 31 | void *serialize_private, |
| 32 | unsigned int stack_pos_ctx, |
| 33 | int *largest_align, |
| 34 | const char *fmt, va_list *args); |
| 35 | |
| 36 | struct ltt_available_probe { |
| 37 | const char *name; /* probe name */ |
| 38 | const char *format; |
| 39 | marker_probe_func *probe_func; |
| 40 | ltt_serialize_cb callbacks[LTT_NR_CALLBACKS]; |
| 41 | struct list_head node; /* registered probes list */ |
| 42 | }; |
| 43 | |
| 44 | extern int ltt_probe_register(struct ltt_available_probe *pdata); |
| 45 | extern int ltt_probe_unregister(struct ltt_available_probe *pdata); |
| 46 | extern int ltt_marker_connect(const char *channel, const char *mname, |
| 47 | const char *pname); |
| 48 | extern int ltt_marker_disconnect(const char *channel, const char *mname, |
| 49 | const char *pname); |
| 50 | |
| 51 | #endif /* _UST_PROBE_H */ |