[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1504899861.5276.16.camel@tzanussi-mobl.amr.corp.intel.com>
Date: Fri, 08 Sep 2017 14:44:21 -0500
From: Tom Zanussi <tom.zanussi@...ux.intel.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: tglx@...utronix.de, mhiramat@...nel.org, namhyung@...nel.org,
vedang.patel@...el.com, bigeasy@...utronix.de,
joel.opensrc@...il.com, joelaf@...gle.com,
mathieu.desnoyers@...icios.com, baohong.liu@...el.com,
linux-kernel@...r.kernel.org, linux-rt-users@...r.kernel.org
Subject: Re: [PATCH v2 34/40] tracing: Add 'last error' error facility for
hist triggers
On Fri, 2017-09-08 at 15:25 -0400, Steven Rostedt wrote:
> On Tue, 5 Sep 2017 16:57:46 -0500
> Tom Zanussi <tom.zanussi@...ux.intel.com> wrote:
>
> > +static char *hist_err_str;
> > +static char *last_hist_cmd;
> > +
> > +static int hist_err_alloc(void)
> > +{
> > + int ret = 0;
> > +
> > + last_hist_cmd = kzalloc(MAX_FILTER_STR_VAL, GFP_KERNEL);
> > + if (!last_hist_cmd)
> > + return -ENOMEM;
> > +
> > + hist_err_str = kzalloc(MAX_FILTER_STR_VAL, GFP_KERNEL);
> > + if (!hist_err_str) {
> > + kfree(last_hist_cmd);
> > + ret = -ENOMEM;
> > + }
>
> This gets allocated during boot up. Why have it be allocated in the
> first place? Just have it be strings:
>
> static char hist_err_str[MAX_FILTER_STR_VAL];
> static char last_hist_cmd[MAX_FILTER_STR_VAL];
>
> You are not saving any space by doing it this way. In fact, you waste
> it because now you need to add the pointers to the strings.
>
Good point. I'll change that along with the other suggestions below.
Thanks,
Tom
Powered by blists - more mailing lists