Re: [sheepdog] [PATCH 3/4] logger: dump stack frames when showing backtrace

2013-02-27 Thread Liu Yuan
On 02/28/2013 01:15 AM, MORITA Kazutaka wrote: > + sd_eprintf("Set /proc/sys/kernel/yama/ptrace_scope to" > +" zero if you are using Ubuntu."); I don't have /proc/sys/kernel/yama/ptrace_scope in my Ubuntu. I am using 12.04. Thanks, Yuan -- shee

Re: [sheepdog] [PATCH 4/4] sheep: dump cluster info when exiting unexpectedly

2013-02-27 Thread Liu Yuan
On 02/28/2013 03:07 PM, MORITA Kazutaka wrote: > __sys is actually a variable whose type is struct cluster_info, isn't > it? > > static struct cluster_info __sys; > > sd_dump_variable can be used against more things than 'state'. We can > use it to dump any kinds of global and local variables

Re: [sheepdog] [PATCH 4/4] sheep: dump cluster info when exiting unexpectedly

2013-02-27 Thread MORITA Kazutaka
At Thu, 28 Feb 2013 14:25:22 +0800, Liu Yuan wrote: > > On 02/28/2013 01:15 AM, MORITA Kazutaka wrote: > > This introduces sd_dump_variable to dump a variable and call it > > against __sys in crash_handler. > > __sys is not a variable but more a compound structure. Maybe > sd_dump_state is more p

Re: [sheepdog] [PATCH 4/4] sheep: dump cluster info when exiting unexpectedly

2013-02-27 Thread MORITA Kazutaka
At Thu, 28 Feb 2013 14:18:08 +0800, Liu Yuan wrote: > > On 02/28/2013 01:15 AM, MORITA Kazutaka wrote: > > +#define sd_dump_variable(var) ({ \ > > + register void *current_sp asm("rsp"); \ > > + __sd_dump_variable(#var, current_sp); \ > > +}) > > +int __sd_dump_variable(const cha

Re: [sheepdog] [PATCH 4/4] sheep: dump cluster info when exiting unexpectedly

2013-02-27 Thread Liu Yuan
On 02/28/2013 01:15 AM, MORITA Kazutaka wrote: > This introduces sd_dump_variable to dump a variable and call it > against __sys in crash_handler. __sys is not a variable but more a compound structure. Maybe sd_dump_state is more proper to indicate it is internal information? Thanks, Yuan -- she

Re: [sheepdog] [PATCH 4/4] sheep: dump cluster info when exiting unexpectedly

2013-02-27 Thread Liu Yuan
On 02/28/2013 01:15 AM, MORITA Kazutaka wrote: > +#define sd_dump_variable(var) ({ \ > + register void *current_sp asm("rsp"); \ > + __sd_dump_variable(#var, current_sp); \ > +}) > +int __sd_dump_variable(const char *var, const void *base_sp); Why use macro instead of a inl

[sheepdog] [PATCH 4/4] sheep: dump cluster info when exiting unexpectedly

2013-02-27 Thread MORITA Kazutaka
This introduces sd_dump_variable to dump a variable and call it against __sys in crash_handler. Signed-off-by: MORITA Kazutaka --- include/logger.h | 6 ++ lib/logger.c | 45 + sheep/sheep.c| 1 + 3 files changed, 52 insertions(+) diff -

[sheepdog] [PATCH 1/4] logger: use ARG_MAX for limit of command line length

2013-02-27 Thread MORITA Kazutaka
Signed-off-by: MORITA Kazutaka --- lib/logger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/logger.c b/lib/logger.c index 57e0a09..0dd9422 100644 --- a/lib/logger.c +++ b/lib/logger.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "logger

[sheepdog] [PATCH 2/4] logger: prohibit inlining sd_backtrace

2013-02-27 Thread MORITA Kazutaka
This is necessary because sd_backtrace assumes that the top of the stack frames belongs to itself. Signed-off-by: MORITA Kazutaka --- lib/logger.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/logger.c b/lib/logger.c index 0dd9422..a29eaaa 100644 --- a/lib/logger.c +++ b/lib/logger.c @

[sheepdog] [PATCH 0/4] show more debug info when program terminates unexpectedly

2013-02-27 Thread MORITA Kazutaka
This patch dumps function arguments and local variabls for each stack, and cluster info with GDB when the program terminates unexpectedly. Example: If the following diff is added, == --- a/sheep/sheep.c +++ b/sheep/sheep.c @@ -719,6 +719,7 @@ int main(int argc, char **argv) check_host_env

[sheepdog] [PATCH 3/4] logger: dump stack frames when showing backtrace

2013-02-27 Thread MORITA Kazutaka
This dumps all function arguments and local variables for each stack frame using GDB. Signed-off-by: MORITA Kazutaka --- lib/logger.c | 91 ++-- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/lib/logger.c b/lib/logger.c inde