[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160107080320.GB20434@krava.brq.redhat.com>
Date: Thu, 7 Jan 2016 09:03:20 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Jiri Olsa <jolsa@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Stephane Eranian <eranian@...gle.com>,
Andi Kleen <andi@...stfloor.org>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Wang Nan <wangnan0@...wei.com>
Subject: Re: [RFC/PATCH v2] perf report: Show random usage tip on the help
line
On Thu, Jan 07, 2016 at 04:46:22PM +0900, Namhyung Kim wrote:
SNIP
> +const char *perf_report_tip(const char *dirname)
> +{
> + struct strlist *tips;
> + struct str_node *node;
> + char *tip = NULL;
> + struct strlist_config conf = {
> + .dirname = system_path(dirname) ,
> + };
> +
> + tips = strlist__new("tips.txt", &conf);
> + if (tips == NULL || strlist__nr_entries(tips) == 1) {
> + tip = (char *)"Cannot find tips.txt file";
> + goto out;
> + }
> +
> + node = strlist__entry(tips, random() % strlist__nr_entries(tips));
> + if (asprintf(&tip, "Tip: %s", node->s) < 0)
> + tip = (char *)"Not enough memory";
^^^ this could be tip = (char *) "Tip: get more memory!"; ;-)
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists