On 30/08/18 15:18, Jan Beulich wrote:
>>>> On 30.08.18 at 15:06, <[email protected]> wrote:
>> This allows all system domids to be printed by name, rather than special
>> casing the idle vcpus alone.
>>
>> Signed-off-by: Andrew Cooper <[email protected]>
>> ---
>> CC: George Dunlap <[email protected]>
>> CC: Jan Beulich <[email protected]>
>> CC: Konrad Rzeszutek Wilk <[email protected]>
>> CC: Stefano Stabellini <[email protected]>
>> CC: Tim Deegan <[email protected]>
>> CC: Wei Liu <[email protected]>
>> CC: Julien Grall <[email protected]>
>>
>> RFC, because this was proposed before but rejected at the time. I'm looking
>> to try and turn errors like this:
>>
>> (XEN) mm.c:1023:d0v2 pg_owner d32754 l1e_owner d0, but real_pg_owner d0
>> (XEN) mm.c:1099:d0v2 Error getting mfn 810020 (pfn 59db1) from L1 entry
>> 8000000810020227 for l1e_owner d0, pg_owner d32754
>>
>> into the slightly more helpful:
>>
>> (XEN) mm.c:1022:d0v2 pg_owner dXEN l1e_owner d0, but real_pg_owner d0
>> (XEN) mm.c:1098:d0v2 Error getting mfn 810020 (pfn 59db1) from L1 entry
>> 8000000810020227 for l1e_owner d0, pg_owner dXEN
>>
>> although even in this case, the former printk has an awkward corner case of a
>> possibly NULL domain pointer, which can possibly only reasonably be fixed
>> inside pointer() itself.
> Or in print_domain(), producing "NULL".
Sounds like a good plan.
>
>> --- a/docs/misc/printk-formats.txt
>> +++ b/docs/misc/printk-formats.txt
>> @@ -28,5 +28,8 @@ Symbol/Function pointers:
>>
>> Domain and vCPU information:
>>
>> + %pd Domain from a 'struct domain *d' (printed as d<domid>, but
>> with
>> + system domains represented by name, e.g. 'dIDLE')
> This looks a little awkward - how about d<IDLE> etc?
A sample looks like:
dIDLEv0 dIO dXEN dCOW
d<IDLE>v0 d<IO> d<XEN> d<COW>
Another alternative would be:
d[IDLE]v0 d[IO] d[XEN] d[COW]
Which I think I prefer to angle brackets.
>
>> --- a/xen/common/vsprintf.c
>> +++ b/xen/common/vsprintf.c
>> @@ -264,6 +264,41 @@ static char *string(char *str, char *end, const char *s,
>> return str;
>> }
>>
>> +/* Print a domain as d<num> or d<str> for system domains. */
>> +static char *print_domain(char *str, char *end, const struct domain *d)
>> +{
>> + const char *name = NULL;
>> +
>> + if ( str < end )
>> + *str++ = 'd';
> I would guess you've copied this idiom from somewhere, and if so
> it would be good to know where we still have got such broken
> construct(s) left:
No - serves me write from trying to code from memory. Fixed.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel