[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] printf formatter for pci_sbdf_t


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Thu, 18 Jul 2019 11:51:57 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aZtW7WM3o/4jnxjuil1athiDR7DqqvNc0ea+qgSUOM4=; b=YLvBHnVnMFLrNUxr1GX2wX0SGPxVub5eRNiFlO/I+CFr+KnEUHAo0E8K8FQCNxdLX8YYXT2axWOvlKJg3l911M2dn6v/vFtHe6y4MY/rWUWduhmAQeIUxEHJPgij1C22WGvqXUSoyDyXtZfrByUNkqxNLlpa+fOuYkKhRBboF/MpMLxK3Mv3q4Q9G9pdkWy2A7w5w21RXn+YNH4Y/3gGUUXqwtsV34CVbzM3IYEYSCsXEiisSr3nkJTMXNR1J8u9JAf5Spj47V7VUn8UF0+w7omT5qF16qB1yOtZrhbI49vfJkeDFs+3JCHWLXQAVDnaY+Z7Zk9yfaYzQe72KrJcag==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fk9I8KQL7RrQalF/r6Dt/2vkQlT03RhKAqhgyL23zHKeJpv0WJWWu1RP3MEYChk9QQGqcgpBk0jhzkJN+Kl2OQsyGU2sodFIEnVAcyS4Y1QNSct6PBZnLMv315xbxcyICP7Zo/VegK164bk8e0zk7jIB+Gvs+TorRsN3jKN/4095cWNsDoto6DdYKlOBVmboroW+ZWlo0TBAGohVSBck15vAB8puC0rpfSkT+OXPhdkHS/vRkDirZ96Z6CBcbIiKuBIl6r1N1mUGBV4Tldfg9Y1wiLw15fPxANOEddKZHurn37icq7d+ShNohE+Y/UIf9BeA1qsSjF3ad1YXwHoEJQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Delivery-date: Thu, 18 Jul 2019 11:52:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVPKkbqe/gqkIsCkyMLC3anRUky6bPCrxPgAE6U4A=
  • Thread-topic: printf formatter for pci_sbdf_t

On 17.07.2019 19:06, Andrew Cooper wrote:
> On 17/07/2019 15:08, Roger Pau Monné wrote:
>> As part of some PCI related cleanup I'm doing, which includes
>> expanding the usage of pci_sbdf_t, I'm also planning to add a custom
>> printf formatter for pci_sbdf_t [0], so that a SBDF can be printed
>> without having to specify four formatters (and pass four parameters)
>> each time (%04x:%02x:%02x.%u).
>>
>> There's been some debate on the previous version about whether the
>> formatter should be %pp or %op, and I would like to settle on one of
>> them before sending a new version:
> 
> I am firmly opposed to overloading %o.

And I am firmly of the opinion that using %o for SBDF is the more
natural thing to do.

> Nothing about PCI coordinates has anything to do with octal
> representation; its mostly hex.

The domain and vCPU IDs aren#t pointer-ish either, for example.

> And for the record, I'm firmly opposed to overloading %[xuid] as well.

I agree that we don#t want to overload any of these.

> %p is the only formatter which has magic overloading so far, and
> avoiding gaining a second would be of substantial value when it comes to
> reading the code.

I don't buy this argument. Readability of some of the printk()
invocations in Roger's patch was (severely imo) hampered by the need
to take addresses of things that could be easily passed by value.
Generated code (size) should be taken into consideration here too,
as should be the (slightly) larger stack consumption when going the
%pp route.

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.