Skip to content

Samples/syscount: add syscount application#29

Merged
jinghao-jia merged 3 commits intorex-rs:mainfrom
hzy-hits:main
Apr 25, 2025
Merged

Samples/syscount: add syscount application#29
jinghao-jia merged 3 commits intorex-rs:mainfrom
hzy-hits:main

Conversation

@hzy-hits
Copy link
Contributor

@hzy-hits hzy-hits commented Apr 24, 2025

Three commits:

  1. rex-macros/tracepoint.rs modifications
  • add hooks events
  1. rex/src/tracepoint/bindings.rs modification
  • add RawSyscallEnterCtx and RawSyscallExitCtx
  1. Syscount implemtations
  • Introduced loader.c for argument parsing using static methods.
  • Removed typedef declarations for enum types throughout the codebase to align with the Linux Kernel coding style.
  • Added the core rex application logic for syscount

@hzy-hits hzy-hits marked this pull request as ready for review April 24, 2025 04:02
Copy link
Member

Choose a reason for hiding this comment

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

Hi, could you remove this .clang-format file. We prefer not to inlucde this file in sample.

Copy link
Member

Choose a reason for hiding this comment

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

And could you use .clang-format from linux kernel

Copy link
Member

Choose a reason for hiding this comment

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

Like

clang-format -i --style=file:../../linux/.clang-format loader.c

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I will remove .clang-format

SHOW_BOTH
} stats_type_t;

void print_header(bool timestamp, stats_type_t type) {
Copy link
Member

Choose a reason for hiding this comment

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

This function should be static

exiting = true;
}

typedef enum {
Copy link
Member

Choose a reason for hiding this comment

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

typedef is still here

char *filter_syscalls;
};

void print_usage(const char *prog_name) {
Copy link
Member

Choose a reason for hiding this comment

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

This function should also be static

@chinrw
Copy link
Member

chinrw commented Apr 24, 2025

Hi, could you help rewrite the commit message to follow our current style and signoff the commits.

@jinghao-jia
Copy link
Member

The last commit (Merge branch 'main' into main) seems unnecessary, can you drop it?

@hzy-hits hzy-hits force-pushed the main branch 3 times, most recently from ddbd227 to 289de72 Compare April 25, 2025 01:17
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this file is still not formatted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

Copy link
Member

@jinghao-jia jinghao-jia left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the hard work!

@jinghao-jia
Copy link
Member

jinghao-jia commented Apr 25, 2025

@hzy-hits it looks like the DCO check failure is because the author name and the sign-off name are different (both the first and the third commit have this problem):

Author: Ivena <huangzhy77@outlook.com>
Date:   Thu Apr 24 20:41:47 2025 -0400

    samples/syscount: add syscount tool

    Signed-off-by: Zhenyu Huang <huangzhy77@outlook.com>

Are you directly using the Signed-off-by tag generated by git?

Signed-off-by: Ivena <huangzhy77@outlook.com>
Signed-off-by: Ivena <huangzhy77@outlook.com>
Signed-off-by: Ivena <huangzhy77@outlook.com>
@hzy-hits
Copy link
Contributor Author

hzy-hits commented Apr 25, 2025

@hzy-hits it looks like the DCO check failure is because the author name and the sign-off name are different (both the first and the third commit have this problem):

Author: Ivena <huangzhy77@outlook.com>
Date:   Thu Apr 24 20:41:47 2025 -0400

    samples/syscount: add syscount tool

    Signed-off-by: Zhenyu Huang <huangzhy77@outlook.com>

Are you directly using the Signed-off-by tag generated by git?

I rebased the commits and signed with author's name. Now all commits' sign-off are generated directly. Hope this time it would pass the workflow check.

Thanks for your patience and guidance. I learn quite a lot from this PR

@jinghao-jia
Copy link
Member

@hzy-hits it looks like the DCO check failure is because the author name and the sign-off name are different (both the first and the third commit have this problem):

Author: Ivena <huangzhy77@outlook.com>
Date:   Thu Apr 24 20:41:47 2025 -0400

    samples/syscount: add syscount tool

    Signed-off-by: Zhenyu Huang <huangzhy77@outlook.com>

Are you directly using the Signed-off-by tag generated by git?

I rebased the commits and signed with author's name. Now all commits' sign-off are generated directly. Hope this time it would pass the workflow check.

Thanks for your patience and guidance. I learn quiet a lot from this PR

No problem! Sorry that we requested so many changes ;)

@jinghao-jia jinghao-jia enabled auto-merge April 25, 2025 02:58
@jinghao-jia jinghao-jia merged commit 97870df into rex-rs:main Apr 25, 2025
4 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.

3 participants