Lines Matching +full:jd +full:- +full:invert

50 #include "pmu-events.h"
88 return -1;
103 free(et->soc_id);
147 strncat(*dst, map + bt->start, blen);
161 --e;
163 --e;
221 for (i = newval->start; i < newval->end; i++) {
223 newval->end = i;
240 json_len(val), map + val->start);
252 { "iMPH-U", "uncore_arb" },
253 { "CPU-M-CF", "cpum_cf" },
254 { "CPU-M-SF", "cpum_sf" },
282 if (!(t)->start && (t) > tokens) \
283 loc = (t) - 1; \
287 err = -EIO; \
308 if (c == '-')
326 return -ENOMEM;
347 FILE *outfp = pd->outfp;
348 char *topic_local = pd->topic;
356 if (je->name)
357 fprintf(outfp, "\t.name = \"%s\",\n", je->name);
358 if (je->event)
359 fprintf(outfp, "\t.event = \"%s\",\n", je->event);
360 fprintf(outfp, "\t.desc = \"%s\",\n", je->desc);
361 if (je->compat)
362 fprintf(outfp, "\t.compat = \"%s\",\n", je->compat);
364 if (je->long_desc && je->long_desc[0])
365 fprintf(outfp, "\t.long_desc = \"%s\",\n", je->long_desc);
366 if (je->pmu)
367 fprintf(outfp, "\t.pmu = \"%s\",\n", je->pmu);
368 if (je->unit)
369 fprintf(outfp, "\t.unit = \"%s\",\n", je->unit);
370 if (je->perpkg)
371 fprintf(outfp, "\t.perpkg = \"%s\",\n", je->perpkg);
372 if (je->aggr_mode)
373 fprintf(outfp, "\t.aggr_mode = \"%d\",\n", convert(je->aggr_mode));
374 if (je->metric_expr)
375 fprintf(outfp, "\t.metric_expr = \"%s\",\n", je->metric_expr);
376 if (je->metric_name)
377 fprintf(outfp, "\t.metric_name = \"%s\",\n", je->metric_name);
378 if (je->metric_group)
379 fprintf(outfp, "\t.metric_group = \"%s\",\n", je->metric_group);
380 if (je->deprecated)
381 fprintf(outfp, "\t.deprecated = \"%s\",\n", je->deprecated);
382 if (je->metric_constraint)
383 fprintf(outfp, "\t.metric_constraint = \"%s\",\n", je->metric_constraint);
407 #define ADD_EVENT_FIELD(field) do { if (je->field) { \
408 es->field = strdup(je->field); \
409 if (!es->field) \
413 #define FREE_EVENT_FIELD(field) free(es->field)
415 #define TRY_FIXUP_FIELD(field) do { if (es->field && !je->field) {\
416 je->field = strdup(es->field); \
417 if (!je->field) \
418 return -ENOMEM; \
444 list_del_init(&es->list);
455 return -ENOMEM;
458 list_add_tail(&es->list, &arch_std_events);
463 return -ENOMEM;
517 if (!strcmp(arch_std, es->name)) {
519 *event = je->event;
526 return -1;
542 return -ENOENT;
546 return -EIO;
547 EXPECT(tokens->type == JSMN_ARRAY, tokens, "expected top level array");
549 for (i = 0; i < tokens->size; i++) {
571 EXPECT(obj->type == JSMN_OBJECT, obj, "expected object");
572 for (j = 0; j < obj->size; j += 2) {
578 EXPECT(field->type == JSMN_STRING, tok + j,
581 EXPECT(val->type == JSMN_STRING, tok + j + 1,
590 } else if (json_streq(map, field, "Invert") && nz) {
723 addfield(map, &event, ",", msr->pname, msrval);
769 EXPECT(tok - tokens == len, tok, "unexpected objects at end");
798 if (c == '-' || c == '/')
821 return !strcmp(fname+len-len2, "/sys");
877 sys_event_table->soc_id,
878 sys_event_table->soc_id);
900 return -1;
907 return -1;
929 if (line[strlen(line)-1] != '\n') {
933 ret = -1;
936 line[strlen(line)-1] = '\0';
988 fprintf(outfp, "#include \"pmu-events/pmu-events.h\"\n");
1027 if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."))
1030 if (dir->d_type == DT_DIR) {
1033 } else if (dir->d_type == DT_UNKNOWN) {
1037 snprintf(path, sizeof(path), "%s/%s", fpath, dir->d_name);
1060 suffix = name + strlen(name) - 5;
1070 int level = ftwbuf->level;
1085 int level = ftwbuf->level;
1097 bname = (char *) fpath + ftwbuf->base - 2;
1101 if (count == level - 1)
1103 bname--;
1107 bname = (char *) fpath + ftwbuf->base;
1109 pr_debug("%s %d %7jd %-20s %s\n",
1111 level, sb->st_size, bname, fpath);
1133 return -1;
1141 return -1;
1143 sys_event_table->soc_id = strdup(tblname);
1144 if (!sys_event_table->soc_id) {
1146 return -1;
1148 list_add_tail(&sys_event_table->list,
1187 return -ENOMEM;
1198 * i.e. if JSON file name cannot be mapped to C-style table name,
1223 * From each JSON file, create a C-style "PMU events table" from the
1229 * Write out the PMU events tables and the mapping table to pmu-event.c.
1271 /* Include pmu-events.h first */
1272 fprintf(eventsfp, "#include \"pmu-events/pmu-events.h\"\n");
1276 * so, not sure if there is a need for symlinks within the pmu-events
1307 pr_info("%s: No CPU->JSON mapping?\n", prog);
1364 return (strcmp((*a)->fts_name, (*b)->fts_name));
1377 /* XXX - nfds is currently unused */
1380 return (-1);
1395 return (-1);
1397 switch (cur->fts_info) {
1428 error = -1;
1431 ftw.base = cur->fts_pathlen - cur->fts_namelen;
1432 ftw.level = cur->fts_level;
1433 error = fn(cur->fts_path, cur->fts_statp, fnflag, &ftw);
1440 error = -1;