[lttng-tools,stable-2.9/2.10] Fix: initializesyscall table when kernel tracer is lazily initialized
diff mbox series

Message ID 20190523165657.19454-1-mathieu.desnoyers@efficios.com
State New
Headers show
Series
  • [lttng-tools,stable-2.9/2.10] Fix: initializesyscall table when kernel tracer is lazily initialized
Related show

Commit Message

Mathieu Desnoyers May 23, 2019, 4:56 p.m. UTC
How to reproduce:

start lttng-sessiond while lttng-modules are not installed, then install
lttng-modules. Then issue "lttng list --syscall -k". It will show an
empty syscall list because the system call list has not been
initialized.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
---
 src/bin/lttng-sessiond/main.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Jérémie Galarneau Sept. 5, 2019, 9:02 p.m. UTC | #1
Merged in stable-2.10 and stable-2.9.

Thanks!
J?r?mie

On Thu, May 23, 2019 at 12:56:57PM -0400, Mathieu Desnoyers wrote:
> How to reproduce:
> 
> start lttng-sessiond while lttng-modules are not installed, then install
> lttng-modules. Then issue "lttng list --syscall -k". It will show an
> empty syscall list because the system call list has not been
> initialized.
> 
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
>  src/bin/lttng-sessiond/main.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c
> index 577936a8..d559306c 100644
> --- a/src/bin/lttng-sessiond/main.c
> +++ b/src/bin/lttng-sessiond/main.c
> @@ -2652,6 +2652,12 @@ static int init_kernel_tracer(void)
>  	}
>  
>  	DBG("Kernel tracer fd %d", kernel_tracer_fd);
> +
> +	ret = syscall_init_table();
> +	if (ret < 0) {
> +		ERR("Unable to populate syscall table. Syscall tracing won't "
> +			"work for this session daemon.");
> +	}
>  	return 0;
>  
>  error_version:
> @@ -5771,14 +5777,6 @@ int main(int argc, char **argv)
>  		/* Setup kernel tracer */
>  		if (!config.no_kernel) {
>  			init_kernel_tracer();
> -			if (kernel_tracer_fd >= 0) {
> -				ret = syscall_init_table();
> -				if (ret < 0) {
> -					ERR("Unable to populate syscall table. "
> -						"Syscall tracing won't work "
> -						"for this session daemon.");
> -				}
> -			}
>  		}
>  
>  		/* Set ulimit for open files */
> -- 
> 2.11.0
>

Patch
diff mbox series

diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c
index 577936a8..d559306c 100644
--- a/src/bin/lttng-sessiond/main.c
+++ b/src/bin/lttng-sessiond/main.c
@@ -2652,6 +2652,12 @@  static int init_kernel_tracer(void)
 	}
 
 	DBG("Kernel tracer fd %d", kernel_tracer_fd);
+
+	ret = syscall_init_table();
+	if (ret < 0) {
+		ERR("Unable to populate syscall table. Syscall tracing won't "
+			"work for this session daemon.");
+	}
 	return 0;
 
 error_version:
@@ -5771,14 +5777,6 @@  int main(int argc, char **argv)
 		/* Setup kernel tracer */
 		if (!config.no_kernel) {
 			init_kernel_tracer();
-			if (kernel_tracer_fd >= 0) {
-				ret = syscall_init_table();
-				if (ret < 0) {
-					ERR("Unable to populate syscall table. "
-						"Syscall tracing won't work "
-						"for this session daemon.");
-				}
-			}
 		}
 
 		/* Set ulimit for open files */