[PATCH v2 2/2] decode-fds: add signalfd fdinfo decoding support

Dmitry V. Levin ldv at strace.io
Sun Mar 26 11:14:46 UTC 2023


On Sun, Mar 26, 2023 at 09:39:47AM +0800, leedagee wrote:
> When signalfds are used, normal signal handling method is not used
> causing strace unable to catch these signals and therefore unable to
> decode them.

"unable to catch" implies that there is something to catch, which is not
the case here.  I suggest to tweak the wording, e.g.

... leaving strace without signals to catch and decode.

> This patch adds a basic a support for signalfd fdinfo decoding.

This patch adds decoding of signal masks associated with signalfd file
descriptors.

> Decoding the buffer content needs more patch but there's also previous

requires additional work

> work by esyr and masatake (see github #199).
> 
> Signed-off-by: leedagee <leedageea at gmail.com>
> ---
>  NEWS                        |  1 +
>  doc/strace.1.in             |  5 ++++-
>  src/filter_qualify.c        |  1 +
>  src/number_set.h            |  1 +
>  src/strace.c                |  3 ++-
>  src/util.c                  | 44 +++++++++++++++++++++++++++++++++++++
>  tests/.gitignore            |  1 +
>  tests/gen_tests.in          |  3 ++-
>  tests/pure_executables.list |  1 +
>  tests/signalfd4-yy.c        |  4 ++++
>  tests/signalfd4.c           | 35 +++++++++++++++++++++++++----
>  11 files changed, 92 insertions(+), 7 deletions(-)
>  create mode 100644 tests/signalfd4-yy.c
> 
> diff --git a/NEWS b/NEWS
> index fa56409ba..08bd2fa91 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -2,6 +2,7 @@ Noteworthy changes in release ?.? (????-??-??)
>  ==============================================
>  
>  * Improvements
> +  * Implemented decoding of signalfd sigmasks.

This makes an impression that the whole issue mentioned in github#199
is now solved.  I suggest a different wording, e.g.

Implemented --decode-fds=signalfd option to decode signal masks
associated with signalfd file descriptors.

>  Noteworthy changes in release 6.2 (2023-02-26)
>  ==============================================
> diff --git a/doc/strace.1.in b/doc/strace.1.in
> index 71661bd2e..b41057519 100644
> --- a/doc/strace.1.in
> +++ b/doc/strace.1.in
> @@ -888,7 +888,7 @@ Decode various information associated with file descriptors.  The default is
>  .I set
>  can include the following elements:
>  .RS
> -.TP 8
> +.TP 9
>  .B path
>  Print file paths.
>  Also enables printing of tracee's current working directory when
> @@ -903,6 +903,9 @@ Print character/block device numbers.
>  .TQ
>  .B pidfd
>  Print PIDs associated with pidfd file descriptors.
> +.TQ
> +.B signalfd
> +Print signal mask for signalfds.

Likewise, I suggest a different wording here, e.g.

Print signal masks associated with signalfd file descriptors.


-- 
ldv


More information about the Strace-devel mailing list