/* * prev_state is of size long, which is 32 bits on 32 bit architectures. * As it needs to have the same bits for both 32 bit and 64 bit architectures * we can just assume that the flags we care about will all be within * the 32 bits.
*/ #define MAX_STATE_BITS 32
/* This is the flags for the prev_state_field, now make them into a string */ for (; sym; sym = sym->next) { long bitmask = strtoul(sym->value, NULL, 0); int i;
/* * Look at the event format fields, and search for where * the prev_state is parsed via the format flags.
*/ for (arg = event->print_fmt.args; arg; arg = arg->next) { /* * Currently, the __print_flags() for the prev_state * is embedded in operations, so they too must be * searched.
*/
sym = search_op(state_field, arg); if (sym) return convert_sym(sym);
} return NULL;
}
line = strtok_r(file, "\n", &next); while (line) {
addr_str = strtok_r(line, ":", &fmt); if (!addr_str) {
pr_warning("printk format with empty entry"); break;
}
addr = strtoull(addr_str, NULL, 16); /* fmt still has a space, skip it */
printk = strdup(fmt+1);
line = strtok_r(NULL, "\n", &next);
tep_register_print_string(pevent, printk, addr);
free(printk);
}
}
void parse_saved_cmdline(struct tep_handle *pevent, char *file, unsignedint size __maybe_unused)
{ char comm[17]; /* Max comm length in the kernel is 16. */ char *line; char *next = NULL; int pid;
line = strtok_r(file, "\n", &next); while (line) { if (sscanf(line, "%d %16s", &pid, comm) == 2)
tep_register_comm(pevent, comm, pid);
line = strtok_r(NULL, "\n", &next);
}
}
unsignedlonglong eval_flag(constchar *flag)
{ int i;
/* * Some flags in the format files do not get converted. * If the flag is not numeric, see if it is something that * we already know about.
*/ if (isdigit(flag[0])) return strtoull(flag, NULL, 0);
for (i = 0; i < (int)(ARRAY_SIZE(flags)); i++) if (strcmp(flags[i].name, flag) == 0) return flags[i].value;
return 0;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.