diff mbox series

[V4,6/9] pldm: Export logging feature

Message ID 20230620145209.88395-7-clombard@linux.ibm.com
State Accepted
Headers show
Series Import external libraries for MCTP/PLDM protocols | expand

Commit Message

Christophe Lombard June 20, 2023, 2:52 p.m. UTC
To retrieve specific log traces from the external library: libmctp, we
need to export the logging api.

Signed-off-by: Christophe Lombard <clombard@linux.ibm.com>
---
 core/console-log.c | 2 +-
 include/skiboot.h  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Nicholas Piggin June 21, 2023, 4:34 a.m. UTC | #1
On Wed Jun 21, 2023 at 12:52 AM AEST, Christophe Lombard wrote:
> To retrieve specific log traces from the external library: libmctp, we
> need to export the logging api.
>
Seems okay. Should it be prefixed with single underscore because it
does not have pr_fmt applied? Otherwise,

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

> Signed-off-by: Christophe Lombard <clombard@linux.ibm.com>
> ---
>  core/console-log.c | 2 +-
>  include/skiboot.h  | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/core/console-log.c b/core/console-log.c
> index 21a1442b..a0d11768 100644
> --- a/core/console-log.c
> +++ b/core/console-log.c
> @@ -15,7 +15,7 @@
>  #include "timebase.h"
>  #include <debug_descriptor.h>
>  
> -static int vprlog(int log_level, const char *fmt, va_list ap)
> +int vprlog(int log_level, const char *fmt, va_list ap)
>  {
>  	int count;
>  	char buffer[320];
> diff --git a/include/skiboot.h b/include/skiboot.h
> index b0b75a42..88857f8f 100644
> --- a/include/skiboot.h
> +++ b/include/skiboot.h
> @@ -79,6 +79,7 @@ static inline bool is_rodata(const void *p)
>  #define pr_fmt(fmt) fmt
>  #endif
>  
> +int vprlog(int log_level, const char *fmt, va_list ap);
>  void _prlog(int log_level, const char* fmt, ...) __attribute__((format (printf, 2, 3)));
>  #define prlog(l, f, ...) do { _prlog(l, pr_fmt(f), ##__VA_ARGS__); } while(0)
>  #define prerror(fmt...)	do { prlog(PR_ERR, fmt); } while(0)
> -- 
> 2.40.1
>
> _______________________________________________
> Skiboot mailing list
> Skiboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
Christophe Lombard June 23, 2023, 3:41 p.m. UTC | #2
Le 21/06/2023 à 06:34, Nicholas Piggin a écrit :
> On Wed Jun 21, 2023 at 12:52 AM AEST, Christophe Lombard wrote:
>> To retrieve specific log traces from the external library: libmctp, we
>> need to export the logging api.
>>
> Seems okay. Should it be prefixed with single underscore because it
> does not have pr_fmt applied? Otherwise,

that would make sense.

> Reviewed-by: Nicholas Piggin<npiggin@gmail.com>
>
>> Signed-off-by: Christophe Lombard<clombard@linux.ibm.com>
>> ---
>>   core/console-log.c | 2 +-
>>   include/skiboot.h  | 1 +
>>   2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/core/console-log.c b/core/console-log.c
>> index 21a1442b..a0d11768 100644
>> --- a/core/console-log.c
>> +++ b/core/console-log.c
>> @@ -15,7 +15,7 @@
>>   #include "timebase.h"
>>   #include <debug_descriptor.h>
>>   
>> -static int vprlog(int log_level, const char *fmt, va_list ap)
>> +int vprlog(int log_level, const char *fmt, va_list ap)
>>   {
>>   	int count;
>>   	char buffer[320];
>> diff --git a/include/skiboot.h b/include/skiboot.h
>> index b0b75a42..88857f8f 100644
>> --- a/include/skiboot.h
>> +++ b/include/skiboot.h
>> @@ -79,6 +79,7 @@ static inline bool is_rodata(const void *p)
>>   #define pr_fmt(fmt) fmt
>>   #endif
>>   
>> +int vprlog(int log_level, const char *fmt, va_list ap);
>>   void _prlog(int log_level, const char* fmt, ...) __attribute__((format (printf, 2, 3)));
>>   #define prlog(l, f, ...) do { _prlog(l, pr_fmt(f), ##__VA_ARGS__); } while(0)
>>   #define prerror(fmt...)	do { prlog(PR_ERR, fmt); } while(0)
>> -- 
>> 2.40.1
>>
>> _______________________________________________
>> Skiboot mailing list
>> Skiboot@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/skiboot
diff mbox series

Patch

diff --git a/core/console-log.c b/core/console-log.c
index 21a1442b..a0d11768 100644
--- a/core/console-log.c
+++ b/core/console-log.c
@@ -15,7 +15,7 @@ 
 #include "timebase.h"
 #include <debug_descriptor.h>
 
-static int vprlog(int log_level, const char *fmt, va_list ap)
+int vprlog(int log_level, const char *fmt, va_list ap)
 {
 	int count;
 	char buffer[320];
diff --git a/include/skiboot.h b/include/skiboot.h
index b0b75a42..88857f8f 100644
--- a/include/skiboot.h
+++ b/include/skiboot.h
@@ -79,6 +79,7 @@  static inline bool is_rodata(const void *p)
 #define pr_fmt(fmt) fmt
 #endif
 
+int vprlog(int log_level, const char *fmt, va_list ap);
 void _prlog(int log_level, const char* fmt, ...) __attribute__((format (printf, 2, 3)));
 #define prlog(l, f, ...) do { _prlog(l, pr_fmt(f), ##__VA_ARGS__); } while(0)
 #define prerror(fmt...)	do { prlog(PR_ERR, fmt); } while(0)