lp:~lttng/lttng-ust/lttng-ust

Created by Alex Montplaisir and last modified
Get this branch:
bzr branch lp:~lttng/lttng-ust/lttng-ust

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Ubuntu LTTng
Project:
LTTng-UST
Status:
Development

Import details

Import Status: Reviewed

This branch is an import of the HEAD branch of the Git repository at git://git.lttng.org/lttng-ust.git.

The next import is scheduled to run .

Last successful import was .

Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 10 seconds — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 10 seconds — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 10 seconds — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 20 seconds — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 10 seconds — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 15 seconds — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 15 seconds — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 10 seconds — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 15 seconds — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 10 seconds — see the log

Recent revisions

2996. By Mathieu Desnoyers

Fix: add missing tracelog-internal.h to makefile

Missing from make dist.

Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: I66ce16b69f003893bac95a54b0a4bb09370ab3bb

2995. By Norbert Lange <email address hidden>

lttng_ust_init_thread: call urcu_register_thread

Eagerly register the thread, and avoid taking mutex during the
first tracepoint.

Signed-off-by: Norbert Lange <email address hidden>
Acked-by: Mathieu Desnoyers <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

2994. By Norbert Lange <email address hidden>

lttng_ust_init_thread: initialise cached context values

Modify all relevant *_alloc_tls functions so that they take
flags for 'init'. Rename them to init_thread for consistency.

So far define one flag LTTNG_UST_INIT_THREAD_CONTEXT_CACHE,
this will warm up cached values so less is done during
the first tracepoint.

The function 'lttng_ust_init_thread' will use all available
flags, software can opt-in to do work early instead
of lazily during tracepoints.

Signed-off-by: Norbert Lange <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

2993. By Norbert Lange <email address hidden>

Improve tracef/tracelog to use the stack for small strings

Support two common cases, one being that the resulting message is
small enough to fit into a on-stack buffer.
The seconds being the common 'printf("%s", "Message")' scheme.

Unfortunately, iterating a va_list is destructive,
so it has to be copied before calling vprintf.

The implementation was moved to a separate file,
used by both tracef.c and tracelog.c.

Signed-off-by: Norbert Lange <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

2992. By Michael Jeanson <email address hidden>

fix: add missing closedir in _get_max_cpuid_from_sysfs()

As reported by Coverity:

*** CID 1490849: (RESOURCE_LEAK)
/src/common/smp.c: 84 in _get_max_cpuid_from_sysfs()
78 * CPU num of 0.
79 */
80 if (max_cpuid < 0 || max_cpuid > INT_MAX)
81 max_cpuid = -1;
82
83 end:
>>> CID 1490849: (RESOURCE_LEAK)
>>> Variable "cpudir" going out of scope leaks the storage it points to.
84 return max_cpuid;
85 }
86
87 /*
88 * As a fallback to parsing the CPU mask in "/sys/devices/system/cpu/possible",
89 * iterate on all the folders in "/sys/devices/system/cpu" that start with

Change-Id: I2048e2473d66aaa2a275fe2923da84a7e105f235
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

2991. By Michael Jeanson <email address hidden>

Add more unit tests for possible_cpus_array_len

Change-Id: If0b7fb9183936f00ac90349fb32f1db57f124602
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

2990. By Michael Jeanson <email address hidden>

Clarify terminolgy around cpu ids and array length

Rename 'num_possible_cpus' to 'possible_cpus_array_len' to make it
clearer that we use this value to create arrays of per-CPU elements.

Change-Id: Ie5dc9293a95bf321f8add7e9c44ac677bc1fe539
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

2989. By Michael Jeanson <email address hidden>

fix: Unify possible CPU number fallback

The MUSL specific fallback to get the number of possible CPUs in the
system has the same issue with hot-unplugged CPUs as the Glibc
implementation we worked around by using the possible CPU mask from
sysfs.

To address this, unify our fallback code across all C libraries to get
the maximum CPU id from the directories in "/sys/devices/system/cpu".

Change-Id: I5541742dc1de8e011a942880825fa88c656f0905
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

2988. By Michael Jeanson <email address hidden>

fix: removed accidental VLA in _get_num_possible_cpus()

The LTTNG_UST_PAGE_SIZE define can either point to a literal value or
the sysconf() function making buf[] a VLA. Replace this by a
cpumask specifc define that will always be a literal value.

Change-Id: I8d329f314878e8018939f979861918969e3ec8ac
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

2987. By Mathieu Desnoyers

Fix: file descriptor leak in get_possible_cpu_mask_from_sysfs

Found by Coverity:

*** CID 1490808: Resource leaks (RESOURCE_LEAK)
/src/common/smp.c: 125 in get_possible_cpu_mask_from_sysfs()
119 max_bytes - total_bytes_read);
120
121 if (bytes_read < 0) {
122 if (errno == EINTR) {
123 continue; /* retry operation */
124 } else {
>>> CID 1490808: Resource leaks (RESOURCE_LEAK)
>>> Handle variable "fd" going out of scope leaks the handle.
125 return -1;
126 }
127 }
128
129 total_bytes_read += bytes_read;
130 assert(total_bytes_read <= max_bytes);

Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: I372b1fa2d454eeaa6462fe9c13692983369bea6b

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.

Subscribers