Skip to content

Filter out configuration file from compile commands #131099

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

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

kwk
Copy link
Contributor

@kwk kwk commented Mar 13, 2025

The commands to run the compilation when printed with -### contain
various irrelevant lines for the perf-training. Most of them are
filtered out already but when configured with
CLANG_CONFIG_FILE_SYSTEM_DIR a new line like the following is
added and needs to be filtered out:

Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg

@kwk kwk self-assigned this Mar 13, 2025
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Mar 13, 2025
@kwk kwk changed the title Filter out configuration line Filter out configuration file from compile command Mar 13, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 13, 2025

@llvm/pr-subscribers-clang

Author: Konrad Kleine (kwk)

Changes

The commands to run the compilation when printed with -### shows various irrelevant lines for the perf-training. Most of them are filtered out already but when configured with
CLANG_CONFIG_FILE_SYSTEM_DIR a new line like the following is added and needs to be filtered out:

Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg


Full diff: https://github.com/llvm/llvm-project/pull/131099.diff

1 Files Affected:

  • (modified) clang/utils/perf-training/perf-helper.py (+1)
diff --git a/clang/utils/perf-training/perf-helper.py b/clang/utils/perf-training/perf-helper.py
index 80c6356d0497c..29904aded5ab0 100644
--- a/clang/utils/perf-training/perf-helper.py
+++ b/clang/utils/perf-training/perf-helper.py
@@ -237,6 +237,7 @@ def get_cc1_command_for_args(cmd, env):
             or ln.startswith("InstalledDir:")
             or ln.startswith("LLVM Profile Note")
             or ln.startswith(" (in-process)")
+            or ln.startswith("Configuration file:")
             or " version " in ln
         ):
             continue

@kwk kwk changed the title Filter out configuration file from compile command Filter out configuration file from compile commands Mar 13, 2025
The commands to run the compilation when printed with `-###` contain
various irrelevant lines for the perf-training. Most of them are
filtered out already but when configured with
`CLANG_CONFIG_FILE_SYSTEM_DIR` a new line like the following is
added and needs to be filtered out:

`Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg`
@kwk kwk force-pushed the filter-out-configuration-line branch from db5d475 to e43271e Compare March 13, 2025 08:21
@kwk kwk requested a review from aaupov March 14, 2025 09:42
@kwk
Copy link
Contributor Author

kwk commented May 8, 2025

@aaupov ping

@kwk kwk requested a review from Copilot June 6, 2025 18:22
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extends the filtering of verbosity in compile commands by excluding configuration file paths output when using CLANG_CONFIG_FILE_SYSTEM_DIR.

  • Added a new filter condition to ignore lines starting with "Configuration file:"
  • Updates the filtering logic in the perf-helper.py script to reduce irrelevant output

@@ -237,6 +237,7 @@ def get_cc1_command_for_args(cmd, env):
or ln.startswith("InstalledDir:")
or ln.startswith("LLVM Profile Note")
or ln.startswith(" (in-process)")
or ln.startswith("Configuration file:")
Copy link
Preview

Copilot AI Jun 6, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider consolidating similar filter conditions into a configurable array or list to simplify future modifications and improve readability.

Copilot uses AI. Check for mistakes.

@kwk kwk merged commit 7db847d into llvm:main Jun 6, 2025
11 checks passed
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
The commands to run the compilation when printed with `-###` contain
various irrelevant lines for the perf-training. Most of them are
filtered out already but when configured with
`CLANG_CONFIG_FILE_SYSTEM_DIR` a new line like the following is
added and needs to be filtered out:

`Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg`
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
The commands to run the compilation when printed with `-###` contain
various irrelevant lines for the perf-training. Most of them are
filtered out already but when configured with
`CLANG_CONFIG_FILE_SYSTEM_DIR` a new line like the following is
added and needs to be filtered out:

`Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants