void cpu_id_get_value(struct lttng_ctx_field *field,
struct lttng_ctx_value *value)
{
- int cpu;
-
- cpu = lttng_ust_get_cpu();
- value->u.s64 = cpu;
+ value->u.s64 = lttng_ust_get_cpu();
}
int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx)
void perf_counter_get_value(struct lttng_ctx_field *field,
struct lttng_ctx_value *value)
{
- uint64_t v;
-
- v = wrapper_perf_counter_read(field);
- value->u.s64 = v;
+ value->u.s64 = wrapper_perf_counter_read(field);
}
/* Called with UST lock held */
static
size_t procname_get_size(struct lttng_ctx_field *field, size_t offset)
{
- size_t size = 0;
-
- size += LTTNG_UST_PROCNAME_LEN;
- return size;
+ return LTTNG_UST_PROCNAME_LEN;
}
static
void procname_get_value(struct lttng_ctx_field *field,
struct lttng_ctx_value *value)
{
- char *procname;
-
- procname = wrapper_getprocname();
- value->u.str = procname;
+ value->u.str = wrapper_getprocname();
}
int lttng_add_procname_to_ctx(struct lttng_ctx **ctx)
void pthread_id_get_value(struct lttng_ctx_field *field,
struct lttng_ctx_value *value)
{
- unsigned long pthread_id;
-
- pthread_id = (unsigned long) pthread_self();
- value->u.s64 = pthread_id;
+ value->u.s64 = (unsigned long) pthread_self();
}
int lttng_add_pthread_id_to_ctx(struct lttng_ctx **ctx)