lkml.org 
[lkml]   [2015]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 2/4] perf tools: Prompt error message for wrong terms of hw/sw events
On Fri, Sep 25, 2015 at 11:11:49AM +0000, He Kuang wrote:

SNIP

> +char *parse_events_formats_error_string(char *additional_terms)
> +{
> + char *str;
> + static const char *static_terms = "config,config1,config2,name,"
> + "period,freq,branch_type,time,"
> + "call-graph,stack-size\n";
> +
> + /* valid terms */
> + if (additional_terms) {
> + if (!asprintf(&str, "valid terms: %s,%s",
> + additional_terms, static_terms))
> + goto fail;
> + free(additional_terms);
> + } else {
> + if (!asprintf(&str, "valid terms: %s", static_terms))
> + goto fail;
> + }
> + return str;
> +
> +fail:
> + return NULL;
> +}

also please change the comment in the flex file

thanks,
jirka


---
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index 936d566f48d8..c29832bce496 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -174,7 +174,7 @@ modifier_bp [rwx]{1,3}

<config>{
/*
- * Please update formats_error_string any time
+ * Please update parse_events_formats_error_string any time
* new static term is added.
*/
config { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_CONFIG); }

\
 
 \ /
  Last update: 2015-09-27 22:41    [W:0.081 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site