projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tracepoint: Don't add NULL probes
[lttng-ust.git]
/
liblttng-ust
/
tracepoint.c
diff --git
a/liblttng-ust/tracepoint.c
b/liblttng-ust/tracepoint.c
index a14c8b34303e43dc40be48cd3aefcd89a31c2197..d7293dab31697d94164f785b0aace9f9824da898 100644
(file)
--- a/
liblttng-ust/tracepoint.c
+++ b/
liblttng-ust/tracepoint.c
@@
-23,6
+23,7
@@
#include <errno.h>
#include <stdint.h>
#include <stddef.h>
#include <errno.h>
#include <stdint.h>
#include <stddef.h>
+#include <stdio.h>
#include <urcu/arch.h>
#include <urcu-bp.h>
#include <urcu/arch.h>
#include <urcu-bp.h>
@@
-37,7
+38,7
@@
#include <helper.h>
#include "tracepoint-internal.h"
#include <helper.h>
#include "tracepoint-internal.h"
-#include "ltt-tracer-core.h"
+#include "ltt
ng
-tracer-core.h"
#include "jhash.h"
#include "error.h"
#include "jhash.h"
#include "error.h"
@@
-77,7
+78,7
@@
static CDS_LIST_HEAD(libs);
* Tracepoint hash table, containing the active tracepoints.
* Protected by tracepoint mutex.
*/
* Tracepoint hash table, containing the active tracepoints.
* Protected by tracepoint mutex.
*/
-#define TRACEPOINT_HASH_BITS
6
+#define TRACEPOINT_HASH_BITS
12
#define TRACEPOINT_TABLE_SIZE (1 << TRACEPOINT_HASH_BITS)
static struct cds_hlist_head tracepoint_table[TRACEPOINT_TABLE_SIZE];
#define TRACEPOINT_TABLE_SIZE (1 << TRACEPOINT_HASH_BITS)
static struct cds_hlist_head tracepoint_table[TRACEPOINT_TABLE_SIZE];
@@
-137,13
+138,15
@@
static void debug_print_probes(struct tracepoint_entry *entry)
static void *
tracepoint_entry_add_probe(struct tracepoint_entry *entry,
static void *
tracepoint_entry_add_probe(struct tracepoint_entry *entry,
- void
*probe
, void *data)
+ void
(*probe)(void)
, void *data)
{
int nr_probes = 0;
struct tracepoint_probe *old, *new;
{
int nr_probes = 0;
struct tracepoint_probe *old, *new;
- WARN_ON(!probe);
-
+ if (!probe) {
+ WARN_ON(1);
+ return ERR_PTR(-EINVAL);
+ }
debug_print_probes(entry);
old = entry->probes;
if (old) {
debug_print_probes(entry);
old = entry->probes;
if (old) {
@@
-169,8
+172,8
@@
tracepoint_entry_add_probe(struct tracepoint_entry *entry,
}
static void *
}
static void *
-tracepoint_entry_remove_probe(struct tracepoint_entry *entry,
void *probe,
- void *data)
+tracepoint_entry_remove_probe(struct tracepoint_entry *entry,
+ void
(*probe)(void), void
*data)
{
int nr_probes = 0, nr_del = 0, i;
struct tracepoint_probe *old, *new;
{
int nr_probes = 0, nr_del = 0, i;
struct tracepoint_probe *old, *new;
@@
-390,7
+393,7
@@
static void tracepoint_update_probes(void)
}
static struct tracepoint_probe *
}
static struct tracepoint_probe *
-tracepoint_add_probe(const char *name, void
*probe
, void *data,
+tracepoint_add_probe(const char *name, void
(*probe)(void)
, void *data,
const char *signature)
{
struct tracepoint_entry *entry;
const char *signature)
{
struct tracepoint_entry *entry;
@@
-417,8
+420,8
@@
tracepoint_add_probe(const char *name, void *probe, void *data,
* The probe address must at least be aligned on the architecture pointer size.
* Called with the tracepoint mutex held.
*/
* The probe address must at least be aligned on the architecture pointer size.
* Called with the tracepoint mutex held.
*/
-int __tracepoint_probe_register(const char *name, void
*probe, void *data
,
- const char *signature)
+int __tracepoint_probe_register(const char *name, void
(*probe)(void)
,
+
void *data,
const char *signature)
{
void *old;
int ret = 0;
{
void *old;
int ret = 0;
@@
-439,7
+442,8
@@
end:
return ret;
}
return ret;
}
-static void *tracepoint_remove_probe(const char *name, void *probe, void *data)
+static void *tracepoint_remove_probe(const char *name, void (*probe)(void),
+ void *data)
{
struct tracepoint_entry *entry;
void *old;
{
struct tracepoint_entry *entry;
void *old;
@@
-461,7
+465,8
@@
static void *tracepoint_remove_probe(const char *name, void *probe, void *data)
* @probe: probe function pointer
* @probe: probe data pointer
*/
* @probe: probe function pointer
* @probe: probe data pointer
*/
-int __tracepoint_probe_unregister(const char *name, void *probe, void *data)
+int __tracepoint_probe_unregister(const char *name, void (*probe)(void),
+ void *data)
{
void *old;
int ret = 0;
{
void *old;
int ret = 0;
@@
-498,7
+503,7
@@
static void tracepoint_add_old_probes(void *old)
*
* caller must call tracepoint_probe_update_all()
*/
*
* caller must call tracepoint_probe_update_all()
*/
-int tracepoint_probe_register_noupdate(const char *name, void
*probe
,
+int tracepoint_probe_register_noupdate(const char *name, void
(*probe)(void)
,
void *data, const char *signature)
{
void *old;
void *data, const char *signature)
{
void *old;
@@
-524,7
+529,7
@@
end:
* caller must call tracepoint_probe_update_all()
* Called with the tracepoint mutex held.
*/
* caller must call tracepoint_probe_update_all()
* Called with the tracepoint mutex held.
*/
-int tracepoint_probe_unregister_noupdate(const char *name, void
*probe
,
+int tracepoint_probe_unregister_noupdate(const char *name, void
(*probe)(void)
,
void *data)
{
void *old;
void *data)
{
void *old;
This page took
0.025522 seconds
and
4
git commands to generate.