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

provider: add 'profile' provider #90

Merged
merged 1 commit into from
Aug 30, 2024
Merged

provider: add 'profile' provider #90

merged 1 commit into from
Aug 30, 2024

Conversation

ismhong
Copy link

@ismhong ismhong commented Sep 26, 2023

The profile provider supports profiling by allowing the user to specify how many times it will fire pre-second. Values of 1-1000 are supported, and the profile provider supports two probe formats as it's original implementation commit 12b8ca2("profile provider support").

  • profile:[N]hz: Profile on all CPUs N times per second
  • profile:[C]:[N]hz: Profile on CPU C N times per second

Test this changes with 4 cores x86-64 PC as below.

$ sudo ./ply 'profile:2:100hz { @[cpu]=count(); } i:1s { print(@); }' 
@:
{  2 }: 100

@:
{  2 }: 200

@:
{  2 }: 300

$ sudo ./ply 'profile:100hz { @[cpu]=count(); } i:1s { print(@); }' 
@:
{  0 }: 100
{  1 }: 100
{  2 }: 100
{  3 }: 100

@:
{  0 }: 200
{  1 }: 200
{  2 }: 200
{  3 }: 200

@:
{  0 }: 300
{  1 }: 300
{  2 }: 300
{  3 }: 300

Change-Id: Ie669db20ed52947f5c75bf91c34f385a64029b19

@wkz
Copy link
Collaborator

wkz commented Aug 26, 2024

This looks great! Sorry for the (extremely long) delay!

If you are still interested in getting this merged, would you mind:

  • Rebasing on the latest master, so that we get regression testing on this branch
  • Adding some new regression tests to test/rootfs/lib/ply/test.sh to cover the profile provider?

@ismhong
Copy link
Author

ismhong commented Aug 28, 2024

Hi @wkz
I have rebased my PR with latest master, and add one regression test in test/rootfs/lib/ply/test.sh. Could you please help to review the changes? Thanks. :)

BTW, it seems there is a workflow changed notification Github raised due to rebase to latest master. I am not sure how to deal with it. Is there anything I done wrong while pushing changes to PR?

Copy link
Collaborator

@wkz wkz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for hanging in there!

Please have a look at my suggestion for the test and see if you agree.

test/rootfs/lib/ply/test.sh Outdated Show resolved Hide resolved
The profile provider supports profiling by allowing the user to specify
how many times it will fire pre-second. Values of 1-1000 are supported,
and the profile provider supports two probe formats as it's original
implementation commit 12b8ca2("profile provider support").

  * profile:[N]hz: Profile on all CPUs N times per second
  * profile:[C]:[N]hz: Profile on CPU C N times per second

Test this changes with 4 cores x86-64 PC as below.

$ sudo ./ply 'profile:2:100hz { @[cpu]=count(); } i:1s { print(@); }'
@:
{  2 }: 100

@:
{  2 }: 200

@:
{  2 }: 300

$ sudo ./ply 'profile:100hz { @[cpu]=count(); } i:1s { print(@); }'
@:
{  0 }: 100
{  1 }: 100
{  2 }: 100
{  3 }: 100

@:
{  0 }: 200
{  1 }: 200
{  2 }: 200
{  3 }: 200

@:
{  0 }: 300
{  1 }: 300
{  2 }: 300
{  3 }: 300

Change-Id: Ie669db20ed52947f5c75bf91c34f385a64029b19
Signed-off-by: Ism Hong <ism.hong@gmail.com>
@wkz wkz merged commit 7a0f266 into iovisor:master Aug 30, 2024
3 checks passed
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.

2 participants