Messages in this thread | | | Date | Thu, 25 Sep 2008 14:55:08 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [RFC PATCH 1/3] Unified trace buffer |
| |
On Thu, 25 Sep 2008, Jeremy Fitzhardinge wrote: > > That suggests that frequency changes should be recorded at a lower layer > as well
Yes and no.
The reason I say "and no" is that it's not technically really possible to atomically give the exact TSC at which the frequency change took place. We just don't have the information, and I doubt we will ever have it.
As such, there is no point in trying to make it a low-level special op, because we'd _still_ end up being totally equivalent with just doing as regular trace-event, with a regular TSC field, and then just fill the data field with the new frequency.
But yes, I do think we'd need to have that as a trace packet type. I thought I even said so in my RFC for packet types. Ahh, it was in the follow-up:
> I guess I should perhaps have put the TSC frequency in there in that "case > 2" thing too. Maybe that should be in "data" (in kHz) and tv_sec/tv_nsec > should be in array[0..1], and the time sync packet would be 24 bytes.
but yes, we obviously need the frequency in order to calculate some kind of wall-clock time (it doesn't _have_ to be in the same packet type as the thing that tries to sync with a real clock, but it makes sense for it to be there.
That said, if people think they can do a good job of ns conversion, I'll stop arguing. Quite frankly, I think people are wrong about that, and quite frankly, I think that anybody who looks even for one second at those "alternate" sched_clock() implementations should realize that they aren't suitable, but whatever. I'm not writing the code, I can only try to convince people to not add the insane call-chains we have now.
Linus
| |