Skip to content

Refactor the cmdline heuristics#1365

Merged
cgzones merged 2 commits intohtop-dev:mainfrom
BenBE:cmdline-checkexe
Jan 27, 2024
Merged

Refactor the cmdline heuristics#1365
cgzones merged 2 commits intohtop-dev:mainfrom
BenBE:cmdline-checkexe

Conversation

@BenBE
Copy link
Copy Markdown
Member

@BenBE BenBE commented Jan 9, 2024

This is mainly a refactor of the command line scanning code.

  1. This tracks if we actually hit any of the patterns we are looking for. This now also properly tracks elements starting at the first character (like relative paths without /).

  2. When the command line starts with the executable name as reported in /proc/<pid>/exe the filesystem check is skipped, thus improving performance.

  3. Improving code flow and documentation of what this does. A big part of the changes can be traced back to flatten the code be re-arranging parts of it.

@BenBE BenBE added enhancement Extension or improvement to existing feature code quality ♻️ Code quality enhancement Linux 🐧 Linux related issues labels Jan 9, 2024
@BenBE BenBE added this to the 3.4.0 milestone Jan 9, 2024
@BenBE BenBE requested review from cgzones and fasterit January 9, 2024 22:37
@BenBE BenBE force-pushed the cmdline-checkexe branch from 9cc2ffa to b9a5bdb Compare January 9, 2024 22:59
BenBE added 2 commits January 25, 2024 10:07
This potentially avoids guessing the right path in the presence of spaces inside the executable path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality ♻️ Code quality enhancement enhancement Extension or improvement to existing feature Linux 🐧 Linux related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing parts in rendering the CMDLINE Incorrect process information for sandboxed applications when "show program path" is disabled

2 participants