View previous topic :: View next topic |
Author |
Message |
krotuss Apprentice
Joined: 01 Aug 2008 Posts: 241
|
Posted: Wed May 01, 2024 10:12 pm Post subject: suspend time accounts into merge time |
|
|
Hi, when I put my computer into S3 sleep while running emerge, I get high "current merge time" reported by genlop because it accounts when computer is in sleep. Can this be configured? I would like to account only time when computer is actually "running". |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1921
|
Posted: Wed May 01, 2024 11:06 pm Post subject: |
|
|
genlop is a log reader. It simply subtracts the start timestamp from the end timestamp. The log does not have consideration for sleep. |
|
Back to top |
|
|
krotuss Apprentice
Joined: 01 Aug 2008 Posts: 241
|
Posted: Thu May 02, 2024 7:14 pm Post subject: |
|
|
Was it ever put under consideration to provide more representative time(s)? Eg. it wasn't implemented because of limited dev resources or because nobody requested it? |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1921
|
Posted: Thu May 02, 2024 8:21 pm Post subject: |
|
|
The log for a build looks like this (emerge.log): Code: | 1714671956: >>> emerge (62 of 62) sys-boot/grub-2.12-r4 to /
1714671956: === (62 of 62) Cleaning (sys-boot/grub-2.12-r4::/var/repo/portage/sys-boot/grub/grub-2.12-r4.ebuild)
1714671957: === (62 of 62) Compiling/Merging (sys-boot/grub-2.12-r4::/var/repo/portage/sys-boot/grub/grub-2.12-r4.ebuild)
1714672227: === (62 of 62) Merging (sys-boot/grub-2.12-r4::/var/repo/portage/sys-boot/grub/grub-2.12-r4.ebuild)
1714672238: >>> AUTOCLEAN: sys-boot/grub:2
1714672238: === Unmerging... (sys-boot/grub-2.12-r2)
1714672240: >>> unmerge success: sys-boot/grub-2.12-r2
1714672243: === (62 of 62) Post-Build Cleaning (sys-boot/grub-2.12-r4::/var/repo/portage/sys-boot/grub/grub-2.12-r4.ebuild)
1714672243: ::: completed emerge (62 of 62) sys-boot/grub-2.12-r4 to / | If you have a better method/format, then file a bug to change emerge. Remember that the log must support async entries since multiple jobs can write intertwined. |
|
Back to top |
|
|
krotuss Apprentice
Joined: 01 Aug 2008 Posts: 241
|
Posted: Thu May 02, 2024 8:38 pm Post subject: |
|
|
It could output something like:
Code: |
1714672243: ::: completed emerge (62 of 62) sys-boot/grub-2.12-r4 to /; merge time: 123; user 456; system 789; whatever...
|
|
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3436
|
Posted: Thu May 02, 2024 11:08 pm Post subject: |
|
|
I don't know how it is actually handled in portage, but standard logging utilities can actually handle timestamps for you, which is very convenient.
You can try e.g. calling something like
logger "my message"
On my system this alone is enough for "my message" to appear in /var/log/everything/current, along with timestamp and tagged with my username.
Doing full accounting of consumed resources would require emerge to actually request accounting data from kernel and explicitly send them to logs, which is a bit of extra work not really related to managing packages AKA going out if its way to provide additional reporting which may or may not be useful.
Note that this data is inherently unreliable anyway, so getting more accurate historic reports won't let you make better predictions. It is always going to be a rough estimation, like the order of magnitude. Like, "am I going to wait for a duration of a sandwich, a walk, or do should I just come back tomorrow?" _________________ Make Computing Fun Again |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9612 Location: beyond the rim
|
Posted: Fri May 03, 2024 7:57 am Post subject: |
|
|
krotuss wrote: | Was it ever put under consideration to provide more representative time(s)? Eg. it wasn't implemented because of limited dev resources or because nobody requested it? |
Both.
krotuss wrote: | It could output something like:
Code: |
1714672243: ::: completed emerge (62 of 62) sys-boot/grub-2.12-r4 to /; merge time: 123; user 456; system 789; whatever...
|
|
Formatting the data isn't the problem, obtaining it is. As building/merging a package isn't just a simple process call but a mix of python and bash code with various subprocesses you can't just copy how bash is doing it with the time builtin (which asks the kernel for resource usage of a single child process, so you can't use it for actual bash code). In particular if you consider edge cases like resumed builds. |
|
Back to top |
|
|
|