Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#1436 closed enhancement (fixed)

Add Signal Tracing to strace (easy)

Reported by: bonefish Owned by: bonefish
Priority: normal Milestone: R1
Component: - General Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

ATM strace prints the traced syscalls only. It could (optionally) also trace signals.

Attachments (5)

patch (3.0 KB) - added by absabs 11 years ago.
screen1.png (76.4 KB) - added by absabs 11 years ago.
newpatch (3.0 KB) - added by absabs 11 years ago.
newpatch.2 (3.0 KB) - added by absabs 11 years ago.
final.patch (3.7 KB) - added by absabs 11 years ago.

Download all attachments as: .zip

Change History (12)

Changed 11 years ago by absabs

Attachment: patch added

Changed 11 years ago by absabs

Attachment: screen1.png added

comment:1 Changed 11 years ago by absabs

when applied the patch, strace now can trace signals tested as following:

  1. in one terminal

strace sleep 666

  1. in another terminal

kill -s sig pid where sig is the signal such as URG\USR1 and so on.

see the screenshot

Changed 11 years ago by absabs

Attachment: newpatch added

comment:2 in reply to:  1 ; Changed 11 years ago by absabs

Resolution: fixed
Status: newclosed

oh, some code for debug was not removed. Now the newpatch should fix the bug Replying to absabs:

when applied the patch, strace now can trace signals tested as following:

  1. in one terminal

strace sleep 666

  1. in another terminal

kill -s sig pid where sig is the signal such as URG\USR1 and so on.

see the screenshot

Changed 11 years ago by absabs

Attachment: newpatch.2 added

comment:3 in reply to:  2 Changed 11 years ago by absabs

sorry for my mistake. Give up "patch\newpatch\newpatch.2", we need only the final.patch Replying to absabs:

oh, some code for debug was not removed. Now the newpatch should fix the bug Replying to absabs:

when applied the patch, strace now can trace signals tested as following:

  1. in one terminal

strace sleep 666

  1. in another terminal

kill -s sig pid where sig is the signal such as URG\USR1 and so on.

see the screenshot

comment:4 Changed 11 years ago by axeld

Thanks for your patch! It looks very nice! Do you have the time to fix the coding style problems (constants have the 'k' prefix, so it would be kSignalName), and add an option to make signal tracing optional? If not, I can make the changes, too, just tell.

comment:5 in reply to:  4 ; Changed 11 years ago by absabs

No problem. I will upload the patch later. :) Replying to axeld:

Thanks for your patch! It looks very nice! Do you have the time to fix the coding style problems (constants have the 'k' prefix, so it would be kSignalName), and add an option to make signal tracing optional? If not, I can make the changes, too, just tell.

Changed 11 years ago by absabs

Attachment: final.patch added

comment:6 in reply to:  5 Changed 11 years ago by absabs

I have updated the final.patch. Thanks Replying to absabs:

No problem. I will upload the patch later. :) Replying to axeld:

Thanks for your patch! It looks very nice! Do you have the time to fix the coding style problems (constants have the 'k' prefix, so it would be kSignalName), and add an option to make signal tracing optional? If not, I can make the changes, too, just tell.

comment:7 Changed 11 years ago by axeld

Thanks! Applied in hrev23436 with minor changes (-g now turns off signal tracing, it's enabled by default).

Note: See TracTickets for help on using tickets.