profile_flame
Version:
A javascript lib renders profile flame graph based on d3.js.
745 lines (743 loc) • 89.1 kB
JavaScript
var exampleData1 = {
flame: {
"height": 25,
"tree": {
"SymbolNotFound!": [
{
"_init": [
{},
36
]
},
37
],
"_start": [
{
"__libc_start_main": [
{
"Py_Main": [
{
"PyRun_SimpleFileExFlags": [
{
"PyRun_FileExFlags": [
{
"PySymtable_Lookup": [
{
"bin/test_trace.py:<module>:10": [
{
"bin/test_trace.py:main:15": [
{
"PyDict_Update": [
{},
141
],
"PyErr_Clear": [
{
"Py_BuildValue": [
{
"_PyImport_Fini": [
{},
149
]
},
395
]
},
395
],
"PyEval_AcquireThread": [
{
"__select": [
{},
46540
]
},
46542
],
"PyImport_ReloadModule": [
{
"PyModule_GetName": [
{
"PyDict_GetItemString": [
{},
15
]
},
15
],
"_PyImportHooks_Init": [
{
"PyList_Size": [
{},
7
],
"__xstat64": [
{},
39
],
"fgets": [
{
"_IO_file_fopen": [
{
"_IO_file_open": [
{
"__open64": [
{},
60
]
},
60
]
},
63
]
},
65
]
},
132
],
"_PyObject_RealIsSubclass": [
{
"PyImport_ExecCodeModuleEx": [
{
"PyEval_EvalCode": [
{
"/usr/lib/python2.7/random.py:<module>:40": [
{
"/usr/lib/python2.7/random.py:Random:72": [
{
"PyFunction_New": [
{
"_PyObject_GC_Malloc": [
{
"PyErr_Occurred": [
{
"PyErr_Occurred": [
{},
7
],
"_PyFloat_Pack8": [
{
"PyDict_Clear": [
{
"_Py_Name": [
{
"_Py_Name": [
{},
10
]
},
10
]
},
10
]
},
10
]
},
34
]
},
35
]
},
36
],
"PyString_InternFromString": [
{},
7
]
},
53
],
"/usr/lib/python2.7/random.py:SystemRandom:805": [
{},
6
],
"/usr/lib/python2.7/random.py:WichmannHill:655": [
{},
7
],
"PyDict_SetItem": [
{},
14
],
"PyErr_NewException": [
{
"PySymtable_Lookup": [
{
"PySymtable_Lookup": [
{
"_Py_Continue": [
{
"/usr/lib/python2.7/random.py:Random.__init__:91": [
{
"/usr/lib/python2.7/random.py:Random.seed:100": [
{
"PyErr_NewException": [
{
"PyNumber_Power": [
{
"PyLong_FromString": [
{},
9
]
},
9
]
},
10
],
"PyLong_FromDouble": [
{
"_PyOS_URandom": [
{
"__read_nocancel": [
{},
302
]
},
307
]
},
308
],
"PyNumber_Power": [
{
"PyNumber_And": [
{
"PyNumber_Absolute": [
{
"_PyLong_New": [
{},
8
]
},
18
]
},
25
],
"PyNumber_Rshift": [
{
"PyNumber_Rshift": [
{
"PyLong_FromLong": [
{},
20
],
"_PyLong_New": [
{
"__libc_malloc": [
{
"_IO_str_seekoff": [
{},
32
]
},
34
]
},
59
]
},
621
]
},
627
],
"_IO_str_seekoff": [
{},
21
]
},
706
]
},
1033
]
},
1037
]
},
1038
]
},
1038
]
},
1038
]
},
1042
],
"PyEval_CallObjectWithKeywords": [
{
"PyCFunction_Call": [
{
"_PyImport_AcquireLock": [
{
"PyObject_IsTrue": [
{},
8
]
},
11
]
},
14
]
},
14
],
"PyObject_CallFunctionObjArgs": [
{
"PyErr_NewException": [
{
"PyErr_NewException": [
{
"PyDict_GetItem": [
{},
9
],
"PyType_Ready": [
{
"PyDescr_NewGetSet": [
{
"PyDescr_NewGetSet": [
{},
6
]
},
7
],
"PyTuple_Pack": [
{
"PyWeakref_NewRef": [
{
"PyErr_Occurred": [
{
"_PyFloat_Pack8": [
{
"PyDict_Clear": [
{
"_Py_Name": [
{},
6
]
},
6
]
},
7
]
},
19
]
},
20
]
},
21
]
},
40
]
},
102
]
},
102
]
},
102
]
},
1276
]
},
1278
]
},
1278
],
"PyMarshal_ReadLongFromFile": [
{
"PyMarshal_ReadLastObjectFromFile": [
{
"PyMarshal_ReadObjectFromString": [
{
"PyMarshal_ReadObjectFromString": [
{
"PyMarshal_ReadObjectFromString": [
{
"PyMarshal_ReadObjectFromString": [
{
"PyMarshal_ReadObjectFromString": [
{
"PyMarshal_ReadObjectFromString": [
{
"PyCode_New": [
{},
13
],
"PyMarshal_ReadObjectFromString": [
{
"PyMarshal_ReadObjectFromString": [
{
"PyList_Append": [
{},
6
],
"PyString_FromStringAndSize": [
{},
17
],
"PyString_InternInPlace": [
{},
25
]
},
71
],
"PyString_FromStringAndSize": [
{},
12
],
"PyTuple_New": [
{
"_PyObject_GC_NewVar": [
{
"PyErr_Occurred": [
{},
14
]
},
15
]
},
33
]
},
135
],
"PyString_InternInPlace": [
{},
7
],
"PyTuple_New": [
{},
7
]
},
177
]
},
186
],
"PyString_InternInPlace": [
{},
7
]
},
207
]
},
210
]
},
213
]
},
213
],
"fread": [
{
"_IO_file_write": [
{
"__read": [
{},
9
]
},
12
]
},
12
]
},
225
],
"PyMarshal_ReadLongFromFile": [
{
"getc": [
{
"_IO_default_uflow": [
{
"_IO_file_underflow": [
{
"_IO_doallocbuf": [
{
"_IO_file_doallocate": [
{
"mmap64": [
{},
9
]
},
10
]
},
10
],
"__read": [
{},
7
]
},
18
]
},
18
]
},
18
]
},
18
]
},
243
],
"__fxstat64": [
{},
9
],
"fclose": [
{
"_IO_file_close_it": [
{
"_IO_setb": [
{
"munmap": [
{},
9
]
},
9
]
},
12
]
},
13
]
},
1551
]
},
1709
],
"PyList_Append": [
{
"realloc": [
{
"_IO_str_seekoff": [
{
"_IO_str_seekoff": [
{},
10
],
"memccpy": [
{},
13
]
},
27
]
},
29
]
},
325
],
"PyObject_GetAttr": [
{
"PyDict_GetItem": [
{},
370
]
},
1434
],
"PyThread_get_thread_ident": [
{},
279
],
"PyUnicodeUCS4_DecodeLatin1": [
{},
1505
],
"_Py_Repr": [
{
"PyIter_Next": [
{
"_Py_Compare": [
{},
274
]
},
394
],
"__sigsetjmp": [
{},
256
],
"_setjmp": [
{},
29
]
},
1027
],
"inititertools": [
{},
319
]
},
56502
]
},
56502
]
},
56502
]
},
56502
]
},
56502
]
},
56502
]
},
56502
]
},
56502
]
}
},
};
var exampleData2 = {
flame: {
"height": 25,
"tree": {
"SymbolNotFound!": [
{
"_init": [
{},
24
]
},
24
],
"_start": [
{
"__libc_start_main": [
{
"Py_Main": [
{
"PyRun_SimpleFileExFlags": [
{
"PyRun_FileExFlags": [
{
"PySymtable_Lookup": [
{
"bin/test_trace.py:<module>:10": [
{
"bin/test_trace.py:main:15": [
{
"PyDict_Update": [
{},
142
],
"PyErr_Clear": [
{
"Py_BuildValue": [
{
"_PyImport_Fini": [
{},
134
]
},
361
]
},
361
],
"PyEval_AcquireThread": [
{
"__select": [
{},
46538
]
},
46540
],
"PyImport_ReloadModule": [
{
"PyModule_GetName": [
{
"PyDict_GetItemString": [
{},
6
]
},
6
],
"_PyImportHooks_Init": [
{
"PySys_GetObject": [
{},
7
],
"__xstat64": [
{},
68
],
"fgets": [
{
"_IO_file_fopen": [
{
"_IO_file_open": [
{
"__open64": [
{},
56
]
},
56
]
},
58
]
},
64
]
},
157
],
"_PyObject_RealIsSubclass": [
{
"PyImport_ExecCodeModuleEx": [
{
"PyEval_EvalCode": [
{
"/usr/lib/python2.7/random.py:<module>:40": [
{
"/usr/lib/python2.7/random.py:Random:72": [