projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: update sched instrumentation for kernel 4.12
[lttng-modules.git]
/
lttng-tracker-pid.c
diff --git
a/lttng-tracker-pid.c
b/lttng-tracker-pid.c
index f8f0a51dcc1e738727286b69e28f343ac43476e1..02b15c42697b2123595883b1704320cc6275bf70 100644
(file)
--- a/
lttng-tracker-pid.c
+++ b/
lttng-tracker-pid.c
@@
-25,12
+25,13
@@
#include <linux/err.h>
#include <linux/seq_file.h>
#include <linux/stringify.h>
#include <linux/err.h>
#include <linux/seq_file.h>
#include <linux/stringify.h>
-#include <linux/rculist.h>
#include <linux/hash.h>
#include <linux/rcupdate.h>
#include <linux/hash.h>
#include <linux/rcupdate.h>
-#include "wrapper/tracepoint.h"
-#include "lttng-events.h"
+#include <wrapper/tracepoint.h>
+#include <wrapper/rcu.h>
+#include <wrapper/list.h>
+#include <lttng-events.h>
/*
* Hash table is allocated and freed when there are no possible
/*
* Hash table is allocated and freed when there are no possible
@@
-42,10
+43,10
@@
* sessions_mutex across calls to create, destroy, add, and del
* functions of this API.
*/
* sessions_mutex across calls to create, destroy, add, and del
* functions of this API.
*/
-struct lttng_pid_hash_node {
- struct hlist_node hlist;
-
int
pid;
-}
;
+int lttng_pid_tracker_get_node_pid(const struct lttng_pid_hash_node *node)
+{
+
return node->
pid;
+}
/*
* Lookup performed from RCU read-side critical section (RCU sched),
/*
* Lookup performed from RCU read-side critical section (RCU sched),
@@
-59,7
+60,7
@@
bool lttng_pid_tracker_lookup(struct lttng_pid_tracker *lpf, int pid)
uint32_t hash = hash_32(pid, 32);
head = &lpf->pid_hash[hash & (LTTNG_PID_TABLE_SIZE - 1)];
uint32_t hash = hash_32(pid, 32);
head = &lpf->pid_hash[hash & (LTTNG_PID_TABLE_SIZE - 1)];
-
hlist_for_each_entry_rcu_notrace
(e, head, hlist) {
+
lttng_hlist_for_each_entry_rcu
(e, head, hlist) {
if (pid == e->pid)
return 1; /* Found */
}
if (pid == e->pid)
return 1; /* Found */
}
@@
-77,7
+78,7
@@
int lttng_pid_tracker_add(struct lttng_pid_tracker *lpf, int pid)
uint32_t hash = hash_32(pid, 32);
head = &lpf->pid_hash[hash & (LTTNG_PID_TABLE_SIZE - 1)];
uint32_t hash = hash_32(pid, 32);
head = &lpf->pid_hash[hash & (LTTNG_PID_TABLE_SIZE - 1)];
- hlist_for_each_entry(e, head, hlist) {
+
lttng_
hlist_for_each_entry(e, head, hlist) {
if (pid == e->pid)
return -EEXIST;
}
if (pid == e->pid)
return -EEXIST;
}
@@
-127,7
+128,7
@@
int lttng_pid_tracker_del(struct lttng_pid_tracker *lpf, int pid)
* No need of _safe iteration, because we stop traversal as soon
* as we remove the entry.
*/
* No need of _safe iteration, because we stop traversal as soon
* as we remove the entry.
*/
- hlist_for_each_entry(e, head, hlist) {
+
lttng_
hlist_for_each_entry(e, head, hlist) {
if (pid == e->pid) {
pid_tracker_del_node_rcu(e);
return 0;
if (pid == e->pid) {
pid_tracker_del_node_rcu(e);
return 0;
@@
-150,7
+151,7
@@
void lttng_pid_tracker_destroy(struct lttng_pid_tracker *lpf)
struct lttng_pid_hash_node *e;
struct hlist_node *tmp;
struct lttng_pid_hash_node *e;
struct hlist_node *tmp;
- hlist_for_each_entry_safe(e, tmp, head, hlist)
+
lttng_
hlist_for_each_entry_safe(e, tmp, head, hlist)
pid_tracker_del_node(e);
}
kfree(lpf);
pid_tracker_del_node(e);
}
kfree(lpf);
This page took
0.023477 seconds
and
4
git commands to generate.