projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add lttng hash table support to liblttng-consumer
[lttng-tools.git]
/
lttng-sessiond
/
event.c
diff --git
a/lttng-sessiond/event.c
b/lttng-sessiond/event.c
index c8274c6bcf8a9100aed41422ff9db96734c01cf9..8582d2f8fc4907e59745feb07c93473ee08c7733 100644
(file)
--- a/
lttng-sessiond/event.c
+++ b/
lttng-sessiond/event.c
@@
-15,17
+15,18
@@
* Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#define _GNU_SOURCE
#include <errno.h>
#include <urcu/list.h>
#include <string.h>
#include <lttng/lttng.h>
#include <errno.h>
#include <urcu/list.h>
#include <string.h>
#include <lttng/lttng.h>
+#include <lttng-ht.h>
#include <lttng-sessiond-comm.h>
#include <lttngerr.h>
#include "channel.h"
#include "event.h"
#include <lttng-sessiond-comm.h>
#include <lttngerr.h>
#include "channel.h"
#include "event.h"
-#include "hashtable.h"
#include "kernel.h"
#include "ust-ctl.h"
#include "ust-app.h"
#include "kernel.h"
#include "ust-ctl.h"
#include "ust-app.h"
@@
-259,7
+260,7
@@
int event_ust_enable_all_tracepoints(struct ltt_ust_session *usess, int domain,
{
int ret, i;
size_t size;
{
int ret, i;
size_t size;
- struct
cds_lf
ht_iter iter;
+ struct
lttng_
ht_iter iter;
struct ltt_ust_event *uevent = NULL;
struct lttng_event *events = NULL;
struct ltt_ust_event *uevent = NULL;
struct lttng_event *events = NULL;
@@
-267,7
+268,8
@@
int event_ust_enable_all_tracepoints(struct ltt_ust_session *usess, int domain,
case LTTNG_DOMAIN_UST:
{
/* Enable existing events */
case LTTNG_DOMAIN_UST:
{
/* Enable existing events */
- cds_lfht_for_each_entry(uchan->events, &iter, uevent, node) {
+ cds_lfht_for_each_entry(uchan->events->ht, &iter.iter, uevent,
+ node.node) {
if (uevent->enabled == 0) {
ret = ust_app_enable_event_glb(usess, uchan, uevent);
if (ret < 0) {
if (uevent->enabled == 0) {
ret = ust_app_enable_event_glb(usess, uchan, uevent);
if (ret < 0) {
@@
-326,7
+328,7
@@
int event_ust_enable_all_tracepoints(struct ltt_ust_session *usess, int domain,
uevent->enabled = 1;
/* Add ltt ust event to channel */
rcu_read_lock();
uevent->enabled = 1;
/* Add ltt ust event to channel */
rcu_read_lock();
-
hashtable_add_unique
(uchan->events, &uevent->node);
+
lttng_ht_add_unique_str
(uchan->events, &uevent->node);
rcu_read_unlock();
}
rcu_read_unlock();
}
@@
-372,7
+374,6
@@
int event_ust_enable_tracepoint(struct ltt_ust_session *usess, int domain,
if (uevent->enabled) {
/* It's already enabled so everything is OK */
if (uevent->enabled) {
/* It's already enabled so everything is OK */
- ret = LTTCOMM_OK;
goto end;
}
goto end;
}
@@
-410,17
+411,15
@@
int event_ust_enable_tracepoint(struct ltt_ust_session *usess, int domain,
/* Add ltt ust event to channel */
if (to_create) {
rcu_read_lock();
/* Add ltt ust event to channel */
if (to_create) {
rcu_read_lock();
-
hashtable_add_unique
(uchan->events, &uevent->node);
+
lttng_ht_add_unique_str
(uchan->events, &uevent->node);
rcu_read_unlock();
}
rcu_read_unlock();
}
- ret = LTTCOMM_OK;
-
-end:
DBG("Event UST %s %s in channel %s", uevent->attr.name,
to_create ? "created" : "enabled", uchan->name);
DBG("Event UST %s %s in channel %s", uevent->attr.name,
to_create ? "created" : "enabled", uchan->name);
- return ret;
+end:
+ return LTTCOMM_OK;
error:
trace_ust_destroy_event(uevent);
error:
trace_ust_destroy_event(uevent);
@@
-483,7
+482,7
@@
int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess, int domain,
{
int ret, i;
size_t size;
{
int ret, i;
size_t size;
- struct
cds_lf
ht_iter iter;
+ struct
lttng_
ht_iter iter;
struct ltt_ust_event *uevent = NULL;
struct lttng_event *events = NULL;
struct ltt_ust_event *uevent = NULL;
struct lttng_event *events = NULL;
@@
-491,7
+490,8
@@
int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess, int domain,
case LTTNG_DOMAIN_UST:
{
/* Disabling existing events */
case LTTNG_DOMAIN_UST:
{
/* Disabling existing events */
- cds_lfht_for_each_entry(uchan->events, &iter, uevent, node) {
+ cds_lfht_for_each_entry(uchan->events->ht, &iter.iter, uevent,
+ node.node) {
if (uevent->enabled == 1) {
ret = ust_app_disable_event_glb(usess, uchan, uevent);
if (ret < 0) {
if (uevent->enabled == 1) {
ret = ust_app_disable_event_glb(usess, uchan, uevent);
if (ret < 0) {
This page took
0.0246 seconds
and
4
git commands to generate.