Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to change signals #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Bojun-Seo
Copy link
Collaborator

Implementation of issue #22

heaptrace uses SIGUSR1 and SIGUSR2 to dump allocation status (in terms of size and count respectively) during process running. But the signal handler will not work properly, if the target process uses one or both of the signals.

So I suggest to add option to change signals to dump allocation status. For example,

# register signal 33 to dump the allocation status sorted in terms of size
$ heaptrace --signal size:33 ./a.out

# register signal 34 to dump the allocation status sorted in terms of count
$ heaptrace --signal count:34 ./a.out

# register signal 33 and 34 to dump the allocation status sorted in terms of size and count respectively
$ heaptrace --signal size:33,count:34 ./a.out

Add signal handler registration interface and modularize signal
handler registration

Signed-off-by: Bojun Seo <[email protected]>
User could register signal to report on specific sort key. The option
format is "KEY1:SIGNO1,KEY2:SIGNO2". The usage is as follows:

  $ heaptrace --signal size:35 samples/samples.out
  $ heaptrace --signal count:35 samples/samples.out
  $ heaptrace --signal count:35,size:36 samples/samples.out

Signed-off-by: Bojun Seo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant