* Line reading and string helpers:
*/
+static char *
+replacestr(char *line, const char *find, const char *replace)
+{
+ char *tail, *s;
+
+ if (!(s = strstr(line, find)))
+ return line;
+
+ tail = s + strlen(find);
+
+ char *newline;
+ asprintf(&newline, "%.*s%s%s", (int)(s - line), line, replace, tail);
+ free(line);
+
+ return newline;
+}
+
static char *lastline;
static char *pushedline;
if (getline(&r, &n, in) < 0)
exit(0);
+ /* Handle section name typo's from earlier kernels: */
+ r = replacestr(r, "CP_MEMPOOOL", "CP_MEMPOOL");
+ r = replacestr(r, "CP_SEQ_STAT", "CP_SQE_STAT");
+
lastline = r;
return r;
}
*/
static void
-dump_cp_seq_stat(uint32_t *stat)
+dump_cp_sqe_stat(uint32_t *stat)
{
printf("\t PC: %04x\n", stat[0]);
stat++;
* so far) not useful, so skip them if not in verbose mode:
*/
bool dump = verbose ||
- !strcmp(name, "CP_SEQ_STAT") ||
+ !strcmp(name, "CP_SQE_STAT") ||
!strcmp(name, "CP_DRAW_STATE") ||
!strcmp(name, "CP_ROQ") ||
0;
- if (!strcmp(name, "CP_SEQ_STAT"))
- dump_cp_seq_stat(buf);
+ if (!strcmp(name, "CP_SQE_STAT"))
+ dump_cp_sqe_stat(buf);
if (!strcmp(name, "CP_UCODE_DBG_DATA"))
dump_cp_ucode_dbg(buf);
- /* note that name was typo'd in earlier kernels: */
- if (!strcmp(name, "CP_MEMPOOL") || !strcmp(name, "CP_MEMPOOOL"))
+ if (!strcmp(name, "CP_MEMPOOL"))
dump_cp_mem_pool(buf);
if (dump)
dump_hex_ascii(buf, 4 * sizedwords, 1);
+
free(buf);
continue;