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

Re: [Xen-devel] [PATCH] x86: drop pointless uses of __func__ / __FUNCTION__



>>> On 24.08.16 at 22:34, <konrad.wilk@xxxxxxxxxx> wrote:
> On Wed, Aug 24, 2016 at 02:02:51AM -0600, Jan Beulich wrote:
>> Non-debugging message text should be (and is in the cases here)
>> distinguishable without also logging function names. Debugging message
>> text, otoh, already includes file name and line number, so also
>> logging function names is redundant. One relatively pointless debugging
>> message gets removed altogether. In another case a mising log level
> 
> s/mising/missing/
>> specifier gets added at once.
> 
> Which one? I was thinking it would be either one of these:
> 
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -1467,8 +1467,7 @@ static int __init verify_tsc_reliability
>>          tsc_check_reliability();
>>          if ( tsc_max_warp )
>>          {
>> -            printk("%s: TSC warp detected, disabling TSC_RELIABLE\n",
>> -                   __func__);
>> +            printk("TSC warp detected, disabling TSC_RELIABLE\n");
>>              setup_clear_cpu_cap(X86_FEATURE_TSC_RELIABLE);
>>          }
>>      }
>> --- a/xen/arch/x86/xstate.c
>> +++ b/xen/arch/x86/xstate.c
>> @@ -574,8 +574,8 @@ void xstate_init(struct cpuinfo_x86 *c)
>>           * We know FP/SSE and YMM about eax, and nothing about edx at 
>> present.
>>           */
>>          xsave_cntxt_size = _xstate_ctxt_size(feature_mask);
>> -        printk("%s: using cntxt_size: %#x and states: %#"PRIx64"\n",
>> -            __func__, xsave_cntxt_size, xfeature_mask);
>> +        printk("xstate: size: %#x and states: %#"PRIx64"\n",
>> +               xsave_cntxt_size, xfeature_mask);
>>  
>>          asm ( "fxsave %0" : "=m" (ctxt) );
>>          if ( ctxt.mxcsr_mask )
>> 
>>
> 
> but both just remove the __func__ usage? 

No, these are (mostly) fine (they could have one added, but there
not being one is not an immediate problem). The respective hunk is

@@ -2385,9 +2383,9 @@ int ioapic_guest_write(unsigned long phy
         spin_unlock_irqrestore(&ioapic_lock, flags);
         rte.vector = desc->arch.vector;
         if ( *(u32*)&rte != ret )
-            WARN_BOGUS_WRITE("old_entry=%08x pirq=%d\n%s: "
-                             "Attempt to modify IO-APIC pin for in-use IRQ!",
-                             ret, pirq, __FUNCTION__);
+            WARN_BOGUS_WRITE("old_entry=%08x pirq=%d\n" XENLOG_INFO
+                             "IO-APIC: Attempt to modify IO-APIC pin for 
in-use IRQ!",
+                             ret, pirq);
         return 0;
     }
 
where a sequence of XENLOG_INFO messages (due to there
being multiple line breaks) is followed one without log level.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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