Definition at line 30 of file build_mig_index.py.
30 def convert(trace_codes, trap_json):
32 with open(trace_codes,
"r")
as f:
34 splitted = re.compile(
"\s+").split(line.rstrip(
"\n"))
36 code =
int(splitted[0], 0)
37 klass = code & 0xFF000000
38 if klass == 0xFF000000:
39 name = name.replace(
"MSG_",
"")
40 num = (code & 0x00FFFFFF) >> 2
43 with open(trap_json,
"r")
as f:
44 traps = json.loads(f.read())
49 data[num] = routine[
"name"]
53 result.append((num, data[num]))
55 result.sort(key=
lambda x: x[0])
58 print(
"#ifndef RZ_MIG_INDEX_H")
59 print(
"#define RZ_MIG_INDEX_H\n")
61 print(
"#define RZ_MIG_INDEX_LEN %d\n" % (
len(data) * 2))
63 print(
"static const char *mig_index[RZ_MIG_INDEX_LEN] = {")
65 print(
'\t"%d", "%s",' % pair)
def convert(trace_codes, trap_json)
References test-lz4-list.exit, int, and len.
Referenced by stream_encode().