<div dir="ltr"><div><div>Hi David,<br></div>OK, I'll rebase onto upstream master and resend the whole series.<br><br><br></div>thanks, Jan<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-13 19:47 GMT+02:00 David Goulet <span dir="ltr"><<a href="mailto:dgoulet@efficios.com" target="_blank">dgoulet@efficios.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jan,<br>
<br>
I was merging those for 2.5 but this one (3/4) does not apply. I tried<br>
to play with it but I can't make it work.<br>
<br>
The only thing that has changed is that we've added a module lately but<br>
even by modifying your patch to add that module, it still does not<br>
apply.<br>
<br>
Do you think you can simply rebase those on upstream master and send it<br>
back to me? (You can also send me a branch, I'm fine with emails or<br>
branch).<br>
<br>
Big thanks!<br>
David<br>
<div><div class="h5"><br>
On 03 Apr (12:57:46), Jan Glauber wrote:<br>
> Remove the per module required parameter by adding another list<br>
> for optional core modules, so we have:<br>
><br>
> - required core modules<br>
> - optional core modules<br>
> - optional probe modules<br>
><br>
> Signed-off-by: Jan Glauber <<a href="mailto:jan.glauber@gmail.com">jan.glauber@gmail.com</a>><br>
> ---<br>
> src/bin/lttng-sessiond/kern-modules.h | 1 -<br>
> src/bin/lttng-sessiond/modprobe.c | 167 ++++++++++++++++++---------------<br>
> 2 files changed, 92 insertions(+), 76 deletions(-)<br>
><br>
> diff --git a/src/bin/lttng-sessiond/kern-modules.h b/src/bin/lttng-sessiond/kern-modules.h<br>
> index 7ce8b0b..ca09fc3 100644<br>
> --- a/src/bin/lttng-sessiond/kern-modules.h<br>
> +++ b/src/bin/lttng-sessiond/kern-modules.h<br>
> @@ -29,7 +29,6 @@<br>
><br>
> struct kern_modules_param {<br>
> const char *name;<br>
> - int required;<br>
> };<br>
><br>
> #endif /* _KERN_MODULES_H */<br>
> diff --git a/src/bin/lttng-sessiond/modprobe.c b/src/bin/lttng-sessiond/modprobe.c<br>
> index ea3fb39..79a01ea 100644<br>
> --- a/src/bin/lttng-sessiond/modprobe.c<br>
> +++ b/src/bin/lttng-sessiond/modprobe.c<br>
> @@ -25,65 +25,72 @@<br>
> #include "modprobe.h"<br>
> #include "kern-modules.h"<br>
><br>
> -/* LTTng kernel tracer base modules list */<br>
> -const struct kern_modules_param kern_modules_control[] = {<br>
> - { "lttng-tracer", 1 }, /* MUST be loaded first so keep at top */<br>
> - { "lttng-lib-ring-buffer", 1 },<br>
> - { "lttng-ring-buffer-client-discard", 1 },<br>
> - { "lttng-ring-buffer-client-overwrite", 1 },<br>
> - { "lttng-ring-buffer-metadata-client", 1 },<br>
> - { "lttng-ring-buffer-client-mmap-discard", 1 },<br>
> - { "lttng-ring-buffer-client-mmap-overwrite", 1 },<br>
> - { "lttng-ring-buffer-metadata-mmap-client", 1 },<br>
> - { "lttng-types", 0 },<br>
> - { "lttng-ftrace", 0 },<br>
> - { "lttng-kprobes", 0 },<br>
> - { "lttng-kretprobes", 0 },<br>
> +#define LTTNG_MOD_REQUIRED 1<br>
> +#define LTTNG_MOD_OPTIONAL 0<br>
> +<br>
> +/* LTTng kernel tracer mandatory core modules list */<br>
> +const struct kern_modules_param kern_modules_control_core[] = {<br>
> + { "lttng-tracer" }, /* MUST be loaded first so keep at top */<br>
> + { "lttng-lib-ring-buffer" },<br>
> + { "lttng-ring-buffer-client-discard" },<br>
> + { "lttng-ring-buffer-client-overwrite" },<br>
> + { "lttng-ring-buffer-metadata-client" },<br>
> + { "lttng-ring-buffer-client-mmap-discard" },<br>
> + { "lttng-ring-buffer-client-mmap-overwrite" },<br>
> + { "lttng-ring-buffer-metadata-mmap-client" },<br>
> +};<br>
> +<br>
> +/* LTTng kernel tracer optional base modules list */<br>
> +const struct kern_modules_param kern_modules_control_opt[] = {<br>
> + { "lttng-types" },<br>
> + { "lttng-ftrace" },<br>
> + { "lttng-kprobes" },<br>
> + { "lttng-kretprobes" },<br>
> };<br>
><br>
> /* LTTng kernel tracer probe modules list */<br>
> const struct kern_modules_param kern_modules_probes[] = {<br>
> - { "lttng-probe-asoc", 0 },<br>
> - { "lttng-probe-block", 0 },<br>
> - { "lttng-probe-btrfs", 0 },<br>
> - { "lttng-probe-compaction", 0 },<br>
> - { "lttng-probe-ext3", 0 },<br>
> - { "lttng-probe-ext4", 0 },<br>
> - { "lttng-probe-gpio", 0 },<br>
> - { "lttng-probe-irq", 0 },<br>
> - { "lttng-probe-jbd", 0 },<br>
> - { "lttng-probe-jbd2", 0 },<br>
> - { "lttng-probe-kmem", 0 },<br>
> - { "lttng-probe-kvm", 0 },<br>
> - { "lttng-probe-kvm-x86", 0 },<br>
> - { "lttng-probe-kvm-x86-mmu", 0 },<br>
> - { "lttng-probe-lock", 0 },<br>
> - { "lttng-probe-module", 0 },<br>
> - { "lttng-probe-napi", 0 },<br>
> - { "lttng-probe-net", 0 },<br>
> - { "lttng-probe-power", 0 },<br>
> - { "lttng-probe-printk", 0 },<br>
> - { "lttng-probe-random", 0 },<br>
> - { "lttng-probe-rcu", 0 },<br>
> - { "lttng-probe-regmap", 0 },<br>
> - { "lttng-probe-regulator", 0 },<br>
> - { "lttng-probe-rpm", 0 },<br>
> - { "lttng-probe-sched", 0 },<br>
> - { "lttng-probe-scsi", 0 },<br>
> - { "lttng-probe-signal", 0 },<br>
> - { "lttng-probe-skb", 0 },<br>
> - { "lttng-probe-sock", 0 },<br>
> - { "lttng-probe-statedump", 0 },<br>
> - { "lttng-probe-sunrpc", 0 },<br>
> - { "lttng-probe-timer", 0 },<br>
> - { "lttng-probe-udp", 0 },<br>
> - { "lttng-probe-vmscan", 0 },<br>
> - { "lttng-probe-workqueue", 0 },<br>
> - { "lttng-probe-writeback", 0 },<br>
> + { "lttng-probe-asoc" },<br>
> + { "lttng-probe-block" },<br>
> + { "lttng-probe-btrfs" },<br>
> + { "lttng-probe-compaction" },<br>
> + { "lttng-probe-ext3" },<br>
> + { "lttng-probe-ext4" },<br>
> + { "lttng-probe-gpio" },<br>
> + { "lttng-probe-irq" },<br>
> + { "lttng-probe-jbd" },<br>
> + { "lttng-probe-jbd2" },<br>
> + { "lttng-probe-kmem" },<br>
> + { "lttng-probe-kvm" },<br>
> + { "lttng-probe-kvm-x86" },<br>
> + { "lttng-probe-kvm-x86-mmu" },<br>
> + { "lttng-probe-lock" },<br>
> + { "lttng-probe-module" },<br>
> + { "lttng-probe-napi" },<br>
> + { "lttng-probe-net" },<br>
> + { "lttng-probe-power" },<br>
> + { "lttng-probe-printk" },<br>
> + { "lttng-probe-random" },<br>
> + { "lttng-probe-rcu" },<br>
> + { "lttng-probe-regmap" },<br>
> + { "lttng-probe-regulator" },<br>
> + { "lttng-probe-rpm" },<br>
> + { "lttng-probe-sched" },<br>
> + { "lttng-probe-scsi" },<br>
> + { "lttng-probe-signal" },<br>
> + { "lttng-probe-skb" },<br>
> + { "lttng-probe-sock" },<br>
> + { "lttng-probe-statedump" },<br>
> + { "lttng-probe-sunrpc" },<br>
> + { "lttng-probe-timer" },<br>
> + { "lttng-probe-udp" },<br>
> + { "lttng-probe-vmscan" },<br>
> + { "lttng-probe-workqueue" },<br>
> + { "lttng-probe-writeback" },<br>
> };<br>
><br>
> void modprobe_remove_lttng(const struct kern_modules_param *modules,<br>
> - int entries)<br>
> + int entries, int required)<br>
> {<br>
> int ret = 0, i;<br>
> char modprobe[256];<br>
> @@ -94,26 +101,21 @@ void modprobe_remove_lttng(const struct kern_modules_param *modules,<br>
> modules[i].name);<br>
> if (ret < 0) {<br>
> PERROR("snprintf modprobe -r");<br>
> - goto error;<br>
> + return;<br>
> }<br>
> modprobe[sizeof(modprobe) - 1] = '\0';<br>
> ret = system(modprobe);<br>
> if (ret == -1) {<br>
> ERR("Unable to launch modprobe -r for module %s",<br>
> - kern_modules_control[i].name);<br>
> - } else if (kern_modules_control[i].required<br>
> - && WEXITSTATUS(ret) != 0) {<br>
> + modules[i].name);<br>
> + } else if (required && WEXITSTATUS(ret) != 0) {<br>
> ERR("Unable to remove module %s",<br>
> - kern_modules_control[i].name);<br>
> + modules[i].name);<br>
> } else {<br>
> DBG("Modprobe removal successful %s",<br>
> - kern_modules_control[i].name);<br>
> + modules[i].name);<br>
> }<br>
> }<br>
> -<br>
> -error:<br>
> - return;<br>
> -<br>
> }<br>
><br>
> /*<br>
> @@ -121,8 +123,12 @@ error:<br>
> */<br>
> void modprobe_remove_lttng_control(void)<br>
> {<br>
> - return modprobe_remove_lttng(kern_modules_control,<br>
> - ARRAY_SIZE(kern_modules_control));<br>
> + modprobe_remove_lttng(kern_modules_control_opt,<br>
> + ARRAY_SIZE(kern_modules_control_opt),<br>
> + LTTNG_MOD_OPTIONAL);<br>
> + modprobe_remove_lttng(kern_modules_control_core,<br>
> + ARRAY_SIZE(kern_modules_control_core),<br>
> + LTTNG_MOD_REQUIRED);<br>
> }<br>
><br>
> /*<br>
> @@ -131,7 +137,8 @@ void modprobe_remove_lttng_control(void)<br>
> void modprobe_remove_lttng_data(void)<br>
> {<br>
> return modprobe_remove_lttng(kern_modules_probes,<br>
> - ARRAY_SIZE(kern_modules_list));<br>
> + ARRAY_SIZE(kern_modules_probes),<br>
> + LTTNG_MOD_OPTIONAL);<br>
> }<br>
><br>
> /*<br>
> @@ -143,7 +150,8 @@ void modprobe_remove_lttng_all(void)<br>
> modprobe_remove_lttng_control();<br>
> }<br>
><br>
> -static int modprobe_lttng(const struct kern_modules_param *modules, int entries)<br>
> +static int modprobe_lttng(const struct kern_modules_param *modules,<br>
> + int entries, int required)<br>
> {<br>
> int ret = 0, i;<br>
> char modprobe[256];<br>
> @@ -151,7 +159,7 @@ static int modprobe_lttng(const struct kern_modules_param *modules, int entries)<br>
> for (i = 0; i < entries; i++) {<br>
> ret = snprintf(modprobe, sizeof(modprobe),<br>
> "/sbin/modprobe %s%s",<br>
> - modules[i].required ? "" : "-q ",<br>
> + required ? "" : "-q ",<br>
> modules[i].name);<br>
> if (ret < 0) {<br>
> PERROR("snprintf modprobe");<br>
> @@ -162,12 +170,10 @@ static int modprobe_lttng(const struct kern_modules_param *modules, int entries)<br>
> if (ret == -1) {<br>
> ERR("Unable to launch modprobe for module %s",<br>
> modules[i].name);<br>
> - } else if (modules[i].required && WEXITSTATUS(ret) != 0) {<br>
> - ERR("Unable to load module %s",<br>
> - modules[i].name);<br>
> + } else if (required && WEXITSTATUS(ret) != 0) {<br>
> + ERR("Unable to load module %s", modules[i].name);<br>
> } else {<br>
> - DBG("Modprobe successfully %s",<br>
> - modules[i].name);<br>
> + DBG("Modprobe successfully %s", modules[i].name);<br>
> }<br>
> }<br>
><br>
> @@ -180,14 +186,25 @@ error:<br>
> */<br>
> int modprobe_lttng_control(void)<br>
> {<br>
> - return modprobe_lttng(kern_modules_control,<br>
> - ARRAY_SIZE(kern_modules_control));<br>
> + int ret;<br>
> +<br>
> + ret = modprobe_lttng(kern_modules_control_core,<br>
> + ARRAY_SIZE(kern_modules_control_core),<br>
> + LTTNG_MOD_REQUIRED);<br>
> + if (ret != 0)<br>
> + return ret;<br>
> + ret = modprobe_lttng(kern_modules_control_opt,<br>
> + ARRAY_SIZE(kern_modules_control_opt),<br>
> + LTTNG_MOD_OPTIONAL);<br>
> + return ret;<br>
> }<br>
> +<br>
> /*<br>
> * Load data kernel module(s).<br>
> */<br>
> int modprobe_lttng_data(void)<br>
> {<br>
> return modprobe_lttng(kern_modules_probes,<br>
> - ARRAY_SIZE(kern_modules_probes));<br>
> + ARRAY_SIZE(kern_modules_probes),<br>
> + LTTNG_MOD_OPTIONAL);<br>
> }<br>
> --<br>
> 1.7.9.5<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a><br>
> <a href="http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
</blockquote></div><br></div>