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

Remove tgid map #1554

Merged

Conversation

marceloamaral
Copy link
Collaborator

With the new task structure in the tracepoint in the code, we can now directly get the previous running task tgid, so that we can remove the map to track and translate the pid to tgid.

Copy link
Contributor

github-actions bot commented Jun 18, 2024

🤖 SeineSailor

Here is a concise summary of the pull request changes:

Summary: The pull request "Remove tgid map" removes the pid_tgid_map map and related functions, leveraging the new task structure in the tracepoint to directly acquire the previous running task's tgid.

Key Modifications:

  • Removal of pid_tgid_map declaration and related functions
  • Update to register_new_process_if_not_exist() function to remove adding new thread ID to process ID list

Impact: The external interface remains unaffected, with no changes to exported function signatures, global data structures, or variables.

Observations: The removal of the pid_tgid_map map simplifies the codebase and reduces dependencies. However, it's essential to ensure that the new task structure in the tracepoint is properly tested to guarantee the correctness of the tgid acquisition.

Suggestions for Improvement: Consider adding tests to validate the correctness of the new task structure and tgid acquisition. Additionally, review the codebase for any potential dependencies on the removed pid_tgid_map map to ensure a smooth transition.

bpfassets/libbpf/src/kepler.bpf.c Outdated Show resolved Hide resolved
bpfassets/libbpf/src/kepler.bpf.c Show resolved Hide resolved
bpfassets/libbpf/src/kepler.bpf.c Outdated Show resolved Hide resolved
@marceloamaral marceloamaral force-pushed the ebpf-tgid-patch branch 2 times, most recently from f218382 to 0991ed5 Compare June 19, 2024 02:13
@@ -231,6 +220,7 @@ int kepler_sched_switch_trace(u64 *ctx)

prev_pid = (u32)prev_task->pid;
next_pid = (u32)next_task->pid;
prev_tgid = next_task->tgid;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be prev_task->tgid?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeap, fixed!

Signed-off-by: marceloamaral <[email protected]>
@rootfs
Copy link
Contributor

rootfs commented Jul 2, 2024

Per 07/02 meeting, this PR is scheduled for 0.7.11 release.

@dave-tucker dave-tucker merged commit 94b3cfe into sustainable-computing-io:main Jul 2, 2024
23 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