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

Fix strace issue #1529

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Fix strace issue #1529

merged 1 commit into from
Sep 18, 2024

Conversation

xzyjj
Copy link

@xzyjj xzyjj commented Aug 29, 2024

Fixed the issue that the CPU is fully loaded due to the process exiting tracked by strace.

Reproduce the process:
gif

TraceScreen.h Outdated
@@ -23,6 +23,7 @@ typedef struct TraceScreen_ {
FILE* strace;
bool contLine;
bool follow;
bool status;
Copy link
Contributor

Choose a reason for hiding this comment

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

The name "status" is unreadable.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, reading through the issue description AND looking at the code, I think status is not very intuitive. I think a better name would be strace_running or strace_alive.

@Explorer09
Copy link
Contributor

Didn't get what you are actually trying to solve. What is the error or problem you are facing? And how to reproduce it?

@xzyjj
Copy link
Author

xzyjj commented Aug 30, 2024

Didn't get what you are actually trying to solve. What is the error or problem you are facing? And how to reproduce it?

Reproduce method:

  1. Execute sleep 100.
  2. Open "htop" and find the sleep 100 process, then press "s" to trace it.
  3. "Ctrl-C" to end sleep 100

@BenBE
Copy link
Member

BenBE commented Aug 30, 2024

Please give this a read-through: https://marker.io/blog/how-to-write-bug-report

Those information should normally appear in the top-most post, where they are easy to find. You can edit your initial post to update these information.

And while I have a hinch what you are talking about, I'll ask you to be precise in your bug report/pull request first to avoid misunderstandings about the scope of what you are trying to achieve.

@BenBE BenBE added enhancement Extension or improvement to existing feature question ❔ Further information is requested labels Aug 30, 2024
TraceScreen.h Outdated
@@ -23,6 +23,7 @@ typedef struct TraceScreen_ {
FILE* strace;
bool contLine;
bool follow;
bool status;
Copy link
Member

Choose a reason for hiding this comment

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

Okay, reading through the issue description AND looking at the code, I think status is not very intuitive. I think a better name would be strace_running or strace_alive.

TraceScreen.c Outdated Show resolved Hide resolved
TraceScreen.c Outdated Show resolved Hide resolved
@BenBE BenBE removed the question ❔ Further information is requested label Sep 4, 2024
@BenBE BenBE added this to the 3.4.0 milestone Sep 4, 2024
@xzyjj xzyjj force-pushed the main branch 2 times, most recently from 3441de4 to 65d9446 Compare September 6, 2024 16:04
Copy link
Contributor

@Explorer09 Explorer09 left a comment

Choose a reason for hiding this comment

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

Please follow the coding style of htop and indent with three spaces. (Yeah, not many projects use three-space indents, but htop is an exception here.)

TraceScreen.c Outdated Show resolved Hide resolved
@BenBE BenBE merged commit 5503cda into htop-dev:main Sep 18, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Extension or improvement to existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants