Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1303478

Re: [RFC/PATCH v2] perf report: Show random usage tip on the help line

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject Re: [RFC/PATCH v2] perf report: Show random usage tip on the help line
Date 2016-01-07 12:00 +0100
Message-ID <qOgsp-6Yo-3@gated-at.bofh.it> (permalink)
References <qOduy-4XK-1@gated-at.bofh.it> <qOdNU-5ly-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jan 07, 2016 at 09:03:20AM +0100, Jiri Olsa wrote:
> 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!";  ;-)

Haha.  Will change. :)

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC/PATCH v2] perf report: Show random usage tip on the help line Namhyung Kim <namhyung@kernel.org> - 2016-01-07 08:50 +0100
  Re: [RFC/PATCH v2] perf report: Show random usage tip on the help  line Jiri Olsa <jolsa@redhat.com> - 2016-01-07 09:10 +0100
    Re: [RFC/PATCH v2] perf report: Show random usage tip on the help  line Jiri Olsa <jolsa@redhat.com> - 2016-01-07 09:20 +0100
      Re: [RFC/PATCH v2] perf report: Show random usage tip on the help  line Namhyung Kim <namhyung@kernel.org> - 2016-01-07 11:50 +0100
    Re: [RFC/PATCH v2] perf report: Show random usage tip on the help  line Namhyung Kim <namhyung@kernel.org> - 2016-01-07 11:50 +0100
  Re: [RFC/PATCH v2] perf report: Show random usage tip on the help  line Jiri Olsa <jolsa@redhat.com> - 2016-01-07 09:10 +0100
    Re: [RFC/PATCH v2] perf report: Show random usage tip on the help  line Namhyung Kim <namhyung@kernel.org> - 2016-01-07 12:00 +0100
  Re: [RFC/PATCH v2] perf report: Show random usage tip on the help  line Andi Kleen <andi@firstfloor.org> - 2016-01-07 17:50 +0100
    Re: [RFC/PATCH v2] perf report: Show random usage tip on the help  line Jiri Olsa <jolsa@redhat.com> - 2016-01-07 19:20 +0100

csiph-web