Skip to content

Conversation

@davidkopp
Copy link
Contributor

Closes #1267

The change was tested successfully:

image

Between the two statements the binary was recompiled with the change introduced in this PR.

This PR includes changes to all Makefiles to add the missing dependency declarations. I had the problem, that re-compiling the metric-provider-binary lead to the message: "'metric-provider-binary' is up to date"
The changed detect_cgroup_path.o was not recognized due to the missing dependency declaration. I hope it is ok to include this change here. If not, let me know.

davidkopp and others added 2 commits August 5, 2025 14:16
Add proper dependencies to Makefile targets that use gmt-lib.o and detect_cgroup_path.o object files. This ensures Make will rebuild the metric-provider-binary when dependency objects change.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link

github-actions bot commented Aug 5, 2025

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 16750109676]:

🌳 CO2 Data:
City: Phoenix, Lat: 33.4532, Lon: -112.0748
IP: 172.182.226.71
CO₂ from energy is: 1.146401900 g
CO₂ from manufacturing (embodied carbon) is: 0.282877228 g
Carbon Intensity for this location: 290 gCO₂eq/kWh
SCI: 1.429279 gCO₂eq / pipeline run emitted


Total cost of whole PR so far:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #124.50063953.113.99991.46
Total Run24.503953.113.99991.46
Additional overhead from Eco CIN/A11.444.072.81

CFLAGS = -O3 -Wall -Werror -lm -I../../../../../../lib/c

metric-provider-binary: source.c
metric-provider-binary: source.c ../../../../../../lib/c/gmt-lib.o
Copy link
Member

Choose a reason for hiding this comment

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

To my understanding this will track the change and rebuild metric-provider-binary if the .o file has changed. But it will also try to rebuild the o-file if their source has changed, not? I wonder if you can build the source from here ... are all the headers / includes set?

Testing would be that you only change the source of the gmt-lib.c and see if the make of the metric-provider-binary rebuilds fully.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, the rebuild happens if the source of the dependency has changed. I tested it with gmt-lib.c: If I add a comment, a rebuild happens. However, a change in the header file does not lead to a rebuild. If that should be the case, the header file has to be added to it too as a dependency:

metric-provider-binary: source.c ../../../../../lib/c/gmt-lib.o ../../../../../lib/c/gmt-lib.h

Should I do that?

Copy link
Member

Choose a reason for hiding this comment

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

hmm actually unsure. I have never seen header files as dependencies. @ribalba Do you have insights here?

Copy link
Member

Choose a reason for hiding this comment

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

I would include the header files too. What we want is that if the functionality would change you should recompile which can happen if you change the .h file.

Let's say you change some buffer size in the .h file and then want to test the metric provider you would expect it to have the new buffer size.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I added the header files as dependencies. I also replaced the long paths to the lib/c directory with a variable.

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

Eco CI Output [RUN-ID: 16775702680]:

🌳 CO2 Data:
City: San Jose, Lat: 37.3388, Lon: -121.8916
IP: 68.220.61.209
CO₂ from energy is: 1.047247300 g
CO₂ from manufacturing (embodied carbon) is: 0.298966074 g
Carbon Intensity for this location: 251 gCO₂eq/kWh
SCI: 1.346213 gCO₂eq / pipeline run emitted


Total cost of whole PR so far:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #124.57284172.33.981047.85
Total Run24.574172.303.981047.85
Additional overhead from Eco CIN/A12.644.103.08

@ArneTR
Copy link
Member

ArneTR commented Aug 7, 2025

LGTM. Just tested the build on macOS and also works. Will merge

@ArneTR ArneTR merged commit 164e3a3 into main Aug 7, 2025
2 checks passed
@ArneTR ArneTR deleted the cgroup-system-metric-providers branch August 7, 2025 05:34
ArneTR added a commit that referenced this pull request Aug 12, 2025
* main:
  Bump actions/create-github-app-token in /.github/workflows (#1284)
  Bump pylint from 3.3.7 to 3.3.8 (#1285)
  Updated echarts vor v.6.0 (#1282)
  Bump python from 3.13.5-slim-bookworm to 3.13.6-slim-bookworm in /docker (#1286)
  Bump deepdiff from 8.5.0 to 8.6.0 (#1283)
  Log parsing on full data (#1276)
  Bump redis from 6.3.0 to 6.4.0 (#1281)
  Added Gemini PR Review
  measurement_flow_process_duration is set in any case. Supplying a timeout of None will lead to no timeout
  Detect systemd cgroup path using cgroup name (instead of container id) (#1270)
  Bump redis from 6.2.0 to 6.3.0 (#1275)
  Removing sampling_rate for XGboost also from codespaces
  lsmod now uses sort
  Added kernel modules to listing
  (fix): Warnings error should not show on HTTP 204 - case is expected
  Fix NetworkIoCgroupSystemProvider doesn't create a value column (#1274)
  Clarifying comment for design decision
  Document the usage of cgroup system metric providers (#1273)
  Suspend check (#1269)
ArneTR added a commit that referenced this pull request Aug 14, 2025
* main:
  Bump actions/create-github-app-token in /.github/workflows (#1284)
  Bump pylint from 3.3.7 to 3.3.8 (#1285)
  Updated echarts vor v.6.0 (#1282)
  Bump python from 3.13.5-slim-bookworm to 3.13.6-slim-bookworm in /docker (#1286)
  Bump deepdiff from 8.5.0 to 8.6.0 (#1283)
  Log parsing on full data (#1276)
  Bump redis from 6.3.0 to 6.4.0 (#1281)
  Added Gemini PR Review
  measurement_flow_process_duration is set in any case. Supplying a timeout of None will lead to no timeout
  Detect systemd cgroup path using cgroup name (instead of container id) (#1270)
  Bump redis from 6.2.0 to 6.3.0 (#1275)
ArneTR added a commit that referenced this pull request Aug 15, 2025
* main: (70 commits)
  Updated Gemini Actions Workflow to latest version from upstream
  Update gemini-pr-review.yml - Only run when actively triggered via comment
  Bump orjson from 3.11.1 to 3.11.2 (#1288)
  Bump actions/create-github-app-token in /.github/workflows (#1284)
  Bump pylint from 3.3.7 to 3.3.8 (#1285)
  Updated echarts vor v.6.0 (#1282)
  Bump python from 3.13.5-slim-bookworm to 3.13.6-slim-bookworm in /docker (#1286)
  Bump deepdiff from 8.5.0 to 8.6.0 (#1283)
  Log parsing on full data (#1276)
  Bump redis from 6.3.0 to 6.4.0 (#1281)
  Added Gemini PR Review
  measurement_flow_process_duration is set in any case. Supplying a timeout of None will lead to no timeout
  Detect systemd cgroup path using cgroup name (instead of container id) (#1270)
  Bump redis from 6.2.0 to 6.3.0 (#1275)
  Removing sampling_rate for XGboost also from codespaces
  lsmod now uses sort
  Added kernel modules to listing
  (fix): Warnings error should not show on HTTP 204 - case is expected
  Fix NetworkIoCgroupSystemProvider doesn't create a value column (#1274)
  Clarifying comment for design decision
  ...
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.

Cgroup System Metric Providers Cannot Handle Cgroup Names/Paths

4 participants