struct process_attr_tracker *tracker;
int integral_value;
enum process_attr_tracker_status status;
- struct ust_app *app;
/*
* Convert process attribute tracker value to the integral
/* Add session to application */
switch (process_attr) {
case LTTNG_PROCESS_ATTR_VIRTUAL_PROCESS_ID:
- app = ust_app_find_by_pid(integral_value);
- if (app) {
- should_update_apps = true;
- }
+ should_update_apps = ust_app_with_pid_exists(integral_value);
break;
default:
should_update_apps = true;
struct process_attr_tracker *tracker;
int integral_value;
enum process_attr_tracker_status status;
- struct ust_app *app;
/*
* Convert process attribute tracker value to the integral
/* Add session to application */
switch (process_attr) {
case LTTNG_PROCESS_ATTR_VIRTUAL_PROCESS_ID:
- app = ust_app_find_by_pid(integral_value);
- if (app) {
- should_update_apps = true;
- }
+ should_update_apps = ust_app_with_pid_exists(integral_value);
break;
default:
should_update_apps = true;
}
/*
- * Return ust app pointer or NULL if not found. RCU read side lock MUST be
+ * Check if a ust_app with a given pid is present. RCU read side lock MUST be
* acquired before calling this function.
*/
-struct ust_app *ust_app_find_by_pid(pid_t pid)
+bool ust_app_with_pid_exists(pid_t pid)
{
- struct ust_app *app = NULL;
struct lttng_ht_node_ulong *node;
struct lttng_ht_iter iter;
+ bool present = false;
lttng_ht_lookup(ust_app_ht, (void *)((unsigned long) pid), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
if (node == NULL) {
- DBG2("UST app no found with pid %d", pid);
- goto error;
+ DBG2("UST app not found with pid %d", pid);
+ goto end;
}
- DBG2("Found UST app by pid %d", pid);
-
- app = caa_container_of(node, struct ust_app, pid_n);
-
-error:
- return app;
+ present = true;
+end:
+ return present;
}
/*
void ust_app_clean_list(void);
int ust_app_ht_alloc(void);
-struct ust_app *ust_app_find_by_pid(pid_t pid);
+bool ust_app_with_pid_exists(pid_t pid);
struct ust_app_stream *ust_app_alloc_stream(void);
int ust_app_recv_registration(int sock, struct ust_register_msg *msg);
int ust_app_recv_notify(int sock);
return NULL;
}
static inline
-struct ust_app *ust_app_find_by_pid(pid_t pid)
+bool ust_app_with_pid_exists(pid_t pid)
{
- return NULL;
+ return false;
}
static inline
uint64_t ust_app_get_size_one_more_packet_per_stream(