Thanks Qiao, I will check it in when I return from vacation.
Dave
Sent from my Verizon Wireless 4G LTE smartphone
-------- Original message --------
From: qiaonuohan <qiaonuohan(a)cn.fujitsu.com>
Date: 07/19/2015 9:08 PM (GMT-08:00)
To: Dave Anderson <anderson(a)redhat.com>, "Discussion list for crash
utility usage, maintenance and development" <crash-utility(a)redhat.com>
Cc: Rabin Vincent <rabinv(a)axis.com>
Subject: Re: [Crash-utility] [PATCH] extensions/trace: max_buffer is optional
On 07/16/2015 09:12 PM, Dave Anderson wrote:
Rabin,
This looks fine to me -- Qiao, can you please ACK this patch?
Thanks,
Dave
----- Original Message -----
> max_buffer is optional in the kernel (depends on the
> CONFIG_TRACE_MAX_TRACE option). Don't fail if it isn't available.
Acked-by: Qiao Nuohan <qiaonuohan(a)cn.fujitsu.com>
> ---
> extensions/trace.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/extensions/trace.c b/extensions/trace.c
> index 9f81568..c269f4c 100644
> --- a/extensions/trace.c
> +++ b/extensions/trace.c
> @@ -34,6 +34,10 @@ static int encapsulated_current_trace;
> * trace_buffer is supported
> */
> static int trace_buffer_available;
> +/*
> + * max_buffer is supported
> + */
> +static int max_buffer_available;
>
> #define koffset(struct, member) struct##_##member##_offset
>
> @@ -163,8 +167,10 @@ static int init_offsets(void)
>
> if (trace_buffer_available) {
> init_offset(trace_array, trace_buffer);
> - init_offset(trace_array, max_buffer);
> init_offset(trace_buffer, buffer);
> +
> + if (max_buffer_available)
> + init_offset(trace_array, max_buffer);
> } else {
> init_offset(trace_array, buffer);
> }
> @@ -448,6 +454,9 @@ out_fail:
> static int ftrace_int_max_tr_trace(void)
> {
> if (trace_buffer_available) {
> + if (!max_buffer_available)
> + return 0;
> +
> global_max_buffer = global_trace + koffset(trace_array, max_buffer);
> read_value(max_tr_ring_buffer, global_max_buffer, trace_buffer, buffer);
> } else {
> @@ -528,6 +537,9 @@ static int ftrace_init(void)
>
> if (MEMBER_EXISTS("trace_array", "trace_buffer")) {
> trace_buffer_available = 1;
> +
> + if (MEMBER_EXISTS("trace_array", "max_buffer"))
> + max_buffer_available = 1;
> } else {
> sym_max_tr_trace = symbol_search("max_tr");
> if (sym_max_tr_trace == NULL)
> --
> 1.7.10.4
>
> --
> Crash-utility mailing list
> Crash-utility(a)redhat.com
>
https://www.redhat.com/mailman/listinfo/crash-utility
>
.
--
Regards
Qiao Nuohan
--
Crash-utility mailing list
Crash-utility(a)redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility