diff options
Diffstat (limited to 'driver/gator_main.c')
-rw-r--r-- | driver/gator_main.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/driver/gator_main.c b/driver/gator_main.c index 4a1f056..55772ef 100644 --- a/driver/gator_main.c +++ b/driver/gator_main.c | |||
@@ -1349,8 +1349,61 @@ static void gator_op_create_files(struct super_block *sb, struct dentry *root) | |||
1349 | /****************************************************************************** | 1349 | /****************************************************************************** |
1350 | * Module | 1350 | * Module |
1351 | ******************************************************************************/ | 1351 | ******************************************************************************/ |
1352 | |||
1353 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) | ||
1354 | |||
1355 | #define GATOR_TRACEPOINTS \ | ||
1356 | GATOR_HANDLE_TRACEPOINT(block_rq_complete); \ | ||
1357 | GATOR_HANDLE_TRACEPOINT(cpu_frequency); \ | ||
1358 | GATOR_HANDLE_TRACEPOINT(cpu_idle); \ | ||
1359 | GATOR_HANDLE_TRACEPOINT(cpu_migrate_begin); \ | ||
1360 | GATOR_HANDLE_TRACEPOINT(cpu_migrate_current); \ | ||
1361 | GATOR_HANDLE_TRACEPOINT(cpu_migrate_finish); \ | ||
1362 | GATOR_HANDLE_TRACEPOINT(irq_handler_exit); \ | ||
1363 | GATOR_HANDLE_TRACEPOINT(mali_hw_counter); \ | ||
1364 | GATOR_HANDLE_TRACEPOINT(mali_job_slots_event); \ | ||
1365 | GATOR_HANDLE_TRACEPOINT(mali_mmu_as_in_use); \ | ||
1366 | GATOR_HANDLE_TRACEPOINT(mali_mmu_as_released); \ | ||
1367 | GATOR_HANDLE_TRACEPOINT(mali_page_fault_insert_pages); \ | ||
1368 | GATOR_HANDLE_TRACEPOINT(mali_pm_status); \ | ||
1369 | GATOR_HANDLE_TRACEPOINT(mali_sw_counter); \ | ||
1370 | GATOR_HANDLE_TRACEPOINT(mali_sw_counters); \ | ||
1371 | GATOR_HANDLE_TRACEPOINT(mali_timeline_event); \ | ||
1372 | GATOR_HANDLE_TRACEPOINT(mali_total_alloc_pages_change); \ | ||
1373 | GATOR_HANDLE_TRACEPOINT(mm_page_alloc); \ | ||
1374 | GATOR_HANDLE_TRACEPOINT(mm_page_free); \ | ||
1375 | GATOR_HANDLE_TRACEPOINT(mm_page_free_batched); \ | ||
1376 | GATOR_HANDLE_TRACEPOINT(sched_process_fork); \ | ||
1377 | GATOR_HANDLE_TRACEPOINT(sched_process_free); \ | ||
1378 | GATOR_HANDLE_TRACEPOINT(sched_switch); \ | ||
1379 | GATOR_HANDLE_TRACEPOINT(softirq_exit); \ | ||
1380 | |||
1381 | #define GATOR_HANDLE_TRACEPOINT(probe_name) \ | ||
1382 | struct tracepoint *gator_tracepoint_##probe_name | ||
1383 | GATOR_TRACEPOINTS; | ||
1384 | #undef GATOR_HANDLE_TRACEPOINT | ||
1385 | |||
1386 | static void gator_fct(struct tracepoint *tp, void *priv) | ||
1387 | { | ||
1388 | #define GATOR_HANDLE_TRACEPOINT(probe_name) \ | ||
1389 | if (strcmp(tp->name, #probe_name) == 0) { \ | ||
1390 | gator_tracepoint_##probe_name = tp; \ | ||
1391 | return; \ | ||
1392 | } | ||
1393 | GATOR_TRACEPOINTS; | ||
1394 | #undef GATOR_HANDLE_TRACEPOINT | ||
1395 | } | ||
1396 | |||
1397 | #else | ||
1398 | |||
1399 | #define for_each_kernel_tracepoint(fct, priv) | ||
1400 | |||
1401 | #endif | ||
1402 | |||
1352 | static int __init gator_module_init(void) | 1403 | static int __init gator_module_init(void) |
1353 | { | 1404 | { |
1405 | for_each_kernel_tracepoint(gator_fct, NULL); | ||
1406 | |||
1354 | if (gatorfs_register()) { | 1407 | if (gatorfs_register()) { |
1355 | return -1; | 1408 | return -1; |
1356 | } | 1409 | } |