private static void parseLine(String line, FtraceEntryCallback callback) {
      Matcher m = sLineWithTgid.matcher(line);
      if (m.matches()) {
        callback.onTraceEntry(
            /*threadname*/ m.group(1),
            /*pid*/ m.group(3).startsWith("-") ? -1 : Integer.parseInt(m.group(3)),
            /*tid*/ Integer.parseInt(m.group(2)),
            /*eventName*/ m.group(6),
            /*details*/ m.group(7));
        return;
      }

      m = sLineWithIrqInfo.matcher(line);
      if (m.matches()) {
        callback.onTraceEntry(
            /*threadname*/ m.group(1),
            /*pid*/ -1,
            /*tid*/ Integer.parseInt(m.group(2)),
            /*eventName*/ m.group(5),
            /*details*/ m.group(6));
        return;
      }

      m = sLineLegacy.matcher(line);
      if (m.matches()) {
        callback.onTraceEntry(
            /*threadname*/ m.group(1),
            /*pid*/ -1,
            /*tid*/ Integer.parseInt(m.group(2)),
            /*eventName*/ m.group(5),
            /*details*/ m.group(6));
        return;
      }
      System.err.println("line doesn't match: " + line);
    }