projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: liblttng-ust-fork Makefile flags mismatch
[lttng-ust.git]
/
liblttng-ust
/
lttng-context-procname.c
diff --git
a/liblttng-ust/lttng-context-procname.c
b/liblttng-ust/lttng-context-procname.c
index d165be88277daada8bbb616c2db60572050f9aa2..0d42be9191958fc0042a74840cc97931cf1fb9f5 100644
(file)
--- a/
liblttng-ust/lttng-context-procname.c
+++ b/
liblttng-ust/lttng-context-procname.c
@@
-3,7
+3,7
@@
*
* LTTng UST procname context.
*
*
* LTTng UST procname context.
*
- * Copyright (C) 2009-201
1
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2009-201
2
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@
-31,8
+31,11
@@
* each event.
* Upon exec, procname changes, but exec takes care of throwing away
* this cached version.
* each event.
* Upon exec, procname changes, but exec takes care of throwing away
* this cached version.
+ * The procname can also change by calling prctl(). The procname should
+ * be set for a thread before the first event is logged within this
+ * thread.
*/
*/
-static char cached_procname[17];
+static
__thread
char cached_procname[17];
static inline
char *wrapper_getprocname(void)
static inline
char *wrapper_getprocname(void)
@@
-61,7
+64,7
@@
size_t procname_get_size(size_t offset)
static
void procname_record(struct lttng_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
static
void procname_record(struct lttng_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
- struct ltt_channel *chan)
+ struct ltt
ng
_channel *chan)
{
char *procname;
{
char *procname;
@@
-94,3
+97,11
@@
int lttng_add_procname_to_ctx(struct lttng_ctx **ctx)
field->record = procname_record;
return 0;
}
field->record = procname_record;
return 0;
}
+
+/*
+ * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ */
+void lttng_fixup_procname_tls(void)
+{
+ asm volatile ("" : : "m" (cached_procname[0]));
+}
This page took
0.025308 seconds
and
4
git commands to generate.