Commit 2bae9a4
committed
add arm64 support for clock frequency helpers
homa_clock() calls get_cycles(), whose backing source is
arch-specific: RDTSC on x86 (frequency tsc_khz) and the
generic timer on arm64 (frequency arch_timer_get_cntfrq()).
Make homa_clock_khz() return the correct value per arch:
- x86: tsc_khz (not cpu_khz -- the kernel tracks them
separately and they can diverge)
- arm64: arch_timer_get_cntfrq() / 1000
- other: 1000000 (fallback)
Guard the tsc_khz-dependent scaling in homa_metrics_print()
behind CONFIG_X86 and emit raw cycle counts on other arches
where Linux and homa_clock() share the same counter.
Replace bare tsc_khz references in timetrace.c with
homa_clock_khz() so the emitted cpu_khz header is correct
on all architectures.
Signed-off-by: Serapheim Dimitropoulos <sdimitropoulos@coreweave.com>1 parent 8f941bf commit 2bae9a4
3 files changed
Lines changed: 28 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
842 | 845 | | |
843 | 846 | | |
844 | 847 | | |
845 | | - | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
846 | 855 | | |
847 | 856 | | |
848 | 857 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
245 | 252 | | |
246 | 253 | | |
247 | 254 | | |
248 | 255 | | |
249 | 256 | | |
250 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
251 | 264 | | |
252 | 265 | | |
253 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
| 393 | + | |
| 394 | + | |
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
| |||
631 | 632 | | |
632 | 633 | | |
633 | 634 | | |
634 | | - | |
| 635 | + | |
635 | 636 | | |
636 | 637 | | |
637 | 638 | | |
| |||
758 | 759 | | |
759 | 760 | | |
760 | 761 | | |
761 | | - | |
| 762 | + | |
762 | 763 | | |
763 | 764 | | |
764 | 765 | | |
| |||
0 commit comments