On Thu, Feb 08, 2018 at 03:25:30PM +, John Garry wrote:
> On 08/02/2018 13:55, Jiri Olsa wrote:
> > On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
> >
> > SNIP
> >
> > >
> > > +static int is_json_file(const char *name)
> > > +{
> > > + const char *suffix;
> > > +
> > > + if (str
On 08/02/2018 13:54, Jiri Olsa wrote:
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
Hi Jirka,
I'll try to combine some responses, below:
SNIP
+static void fixup_field(char *from, char **to)
+{
+ *to = malloc(strlen(from));
+
+ strcpy(*to, from);
+}
+
+#define EVE
On 08/02/2018 14:02, Alan Cox wrote:
On Thu, 8 Feb 2018 14:54:23 +0100
Jiri Olsa wrote:
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
static void print_events_table_suffix(FILE *outfp)
{
fprintf(outfp, "{\n");
@@ -407,6 +469,52 @@ static char *real_event(const c
On 08/02/2018 13:55, Jiri Olsa wrote:
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
+static int is_json_file(const char *name)
+{
+ const char *suffix;
+
+ if (strlen(name) < 5)
+ return 0;
+
+ suffix = name + strlen(name) - 5;
+
+ if (
On 08/02/2018 13:55, Jiri Olsa wrote:
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
For some architectures (like arm), there are architecture-
defined events. Sometimes these events may be "recommended"
according to the architecture standard, in that the
implementer is free ignore
On Thu, Feb 08, 2018 at 02:45:37PM +, John Garry wrote:
> On 08/02/2018 13:55, Jiri Olsa wrote:
> > On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
> >
> > SNIP
> >
> > > + char *perpkg;
> > > + char *unit;
> > > + char *metric_expr;
> > > + char *metric_name;
> > > + char *metric
On 08/02/2018 13:55, Jiri Olsa wrote:
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
+ char *perpkg;
+ char *unit;
+ char *metric_expr;
+ char *metric_name;
+ char *metric_group;
+ struct list_head list;
+ char strings[];
+};
+
+stati
On Thu, 8 Feb 2018 14:54:23 +0100
Jiri Olsa wrote:
> On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
>
> SNIP
>
> > static void print_events_table_suffix(FILE *outfp)
> > {
> > fprintf(outfp, "{\n");
> > @@ -407,6 +469,52 @@ static char *real_event(const char *name, char *even
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
> For some architectures (like arm), there are architecture-
> defined events. Sometimes these events may be "recommended"
> according to the architecture standard, in that the
> implementer is free ignore the "recommendation" and create
>
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
>
> +static int is_json_file(const char *name)
> +{
> + const char *suffix;
> +
> + if (strlen(name) < 5)
> + return 0;
> +
> + suffix = name + strlen(name) - 5;
> +
> + if (strncmp(suffix, ".json", 5)
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
> rc = nftw(ldirname, process_one_file, maxfds, 0);
> if (rc && verbose) {
> pr_info("%s: Error walking file tree %s\n", prog, ldirname);
> - goto empty_map;
> + goto free_standard_a
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
> /* Call func with each event in the json file */
> int json_events(const char *fn,
> int (*func)(void *data, char *name, char *event, char *desc,
> @@ -442,6 +550,7 @@ int json_events(const char *fn,
> char
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
> + char *perpkg;
> + char *unit;
> + char *metric_expr;
> + char *metric_name;
> + char *metric_group;
> + struct list_head list;
> + char strings[];
> +};
> +
> +static LIST_HEAD(arch_std_events);
> +
>
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
> + rc = nftw(ldirname, preprocess_arch_std_files, get_maxfds(), 0);
> + if (rc && verbose) {
> + pr_info("%s: Error preprocessing arch standard files %s\n",
> + prog, ldirname);
> +
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
> @@ -940,6 +1090,7 @@ int main(int argc, char *argv[])
> const char *output_file;
> const char *start_dirname;
> struct stat stbuf;
> + struct event_struct *es1, *es2;
>
> prog = basename(argv[0]);
>
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
> static void print_events_table_suffix(FILE *outfp)
> {
> fprintf(outfp, "{\n");
> @@ -407,6 +469,52 @@ static char *real_event(const char *name, char *event)
> return event;
> }
>
> +static void fixup_field(char *
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
> @@ -366,6 +367,67 @@ static int print_events_table_entry(void *data, char
> *name, char *event,
> return 0;
> }
>
> +struct event_struct {
> + char *name;
> + char *event;
> + char *desc;
> + char *long_d
On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:
SNIP
> +static void fixup_field(char *from, char **to)
> +{
> + *to = malloc(strlen(from));
> +
> + strcpy(*to, from);
> +}
> +
> +#define EVENT_PREFIX "event="
> +
> +#define TRY_FIXUP_FIELD(string) do { if (es->string && !
For some architectures (like arm), there are architecture-
defined events. Sometimes these events may be "recommended"
according to the architecture standard, in that the
implementer is free ignore the "recommendation" and create
its custom event.
This patch adds support for parsing standard event
19 matches
Mail list logo