예제 #1
0
static int gator_events_meminfo_start(void)
{
	int i;

	new_data_avail = true;
	for (i = 0; i < MEMINFO_TOTAL; i++) {
		if (meminfo_enabled[i]) {
			meminfo_global_enabled = 1;
		}
	}

	if (meminfo_global_enabled == 0)
		return 0;

	if (GATOR_REGISTER_TRACE(mm_page_free_direct))
		goto mm_page_free_direct_exit;
	if (GATOR_REGISTER_TRACE(mm_pagevec_free))
		goto mm_pagevec_free_exit;
	if (GATOR_REGISTER_TRACE(mm_page_alloc))
		goto mm_page_alloc_exit;

	return 0;

mm_page_alloc_exit:
	GATOR_UNREGISTER_TRACE(mm_pagevec_free);
mm_pagevec_free_exit:
	GATOR_UNREGISTER_TRACE(mm_page_free_direct);
mm_page_free_direct_exit:
	return -1;
}
예제 #2
0
static int gator_events_meminfo_start(void)
{
	int i;

	new_data_avail = false;
	meminfo_global_enabled = 0;
	for (i = 0; i < MEMINFO_TOTAL; i++) {
		if (meminfo_enabled[i]) {
			meminfo_global_enabled = 1;
			break;
		}
	}

	proc_global_enabled = 0;
	for (i = 0; i < PROC_COUNT; ++i) {
		if (proc_enabled[i]) {
			proc_global_enabled = 1;
			break;
		}
	}
	if (meminfo_enabled[MEMINFO_MEMUSED])
		proc_global_enabled = 1;

	if (meminfo_global_enabled == 0)
		return 0;

	if (GATOR_REGISTER_TRACE(mm_page_free))
		goto mm_page_free_exit;
	if (GATOR_REGISTER_TRACE(mm_page_free_batched))
		goto mm_page_free_batched_exit;
	if (GATOR_REGISTER_TRACE(mm_page_alloc))
		goto mm_page_alloc_exit;

	do_read();
#if USE_THREAD
	/* Start worker thread */
	gator_meminfo_run = true;
	/* Since the mutex starts unlocked, memory values will be initialized */
	if (IS_ERR(kthread_run(gator_meminfo_func, NULL, "gator_meminfo")))
		goto kthread_run_exit;
#else
	setup_deferrable_timer_on_stack(&meminfo_wake_up_timer, meminfo_wake_up_handler, 0);
#endif

	return 0;

#if USE_THREAD
kthread_run_exit:
	GATOR_UNREGISTER_TRACE(mm_page_alloc);
#endif
mm_page_alloc_exit:
	GATOR_UNREGISTER_TRACE(mm_page_free_batched);
mm_page_free_batched_exit:
	GATOR_UNREGISTER_TRACE(mm_page_free);
mm_page_free_exit:
	return -1;
}
예제 #3
0
static void gator_migrate_stop(void)
{
	if (!map_cpuids)
		return;

	GATOR_UNREGISTER_TRACE(cpu_migrate_current);
	GATOR_UNREGISTER_TRACE(cpu_migrate_finish);
	GATOR_UNREGISTER_TRACE(cpu_migrate_begin);
}
예제 #4
0
static void gator_events_irq_stop(void)
{
	if (hardirq_enabled)
		GATOR_UNREGISTER_TRACE(irq_handler_exit);
	if (softirq_enabled)
		GATOR_UNREGISTER_TRACE(softirq_exit);
	pr_debug("gator: unregistered irq tracepoints\n");

	hardirq_enabled = 0;
	softirq_enabled = 0;
}
예제 #5
0
static void gator_events_meminfo_stop(void)
{
	int i;

	if (meminfo_global_enabled) {
		GATOR_UNREGISTER_TRACE(mm_page_free_direct);
		GATOR_UNREGISTER_TRACE(mm_pagevec_free);
		GATOR_UNREGISTER_TRACE(mm_page_alloc);
	}

	meminfo_global_enabled = 0;
	for (i = 0; i < MEMINFO_TOTAL; i++) {
		meminfo_enabled[i] = 0;
	}
}
예제 #6
0
static void gator_events_meminfo_stop(void)
{
	if (meminfo_global_enabled) {
		GATOR_UNREGISTER_TRACE(mm_page_free);
		GATOR_UNREGISTER_TRACE(mm_page_free_batched);
		GATOR_UNREGISTER_TRACE(mm_page_alloc);

#if USE_THREAD
		/* Stop worker thread */
		gator_meminfo_run = false;
		up(&gator_meminfo_sem);
#else
		del_timer_sync(&meminfo_wake_up_timer);
#endif
	}
}
static void gator_events_sched_stop(void)
{
	if (sched_switch_enabled)
		GATOR_UNREGISTER_TRACE(sched_switch);
	pr_debug("gator: unregistered scheduler event tracepoints\n");

	sched_switch_enabled = 0;
}
예제 #8
0
static void gator_events_block_stop(void)
{
    if (block_rq_wr_enabled || block_rq_rd_enabled)
        GATOR_UNREGISTER_TRACE(block_rq_complete);
    pr_debug("gator: unregistered block event tracepoints\n");

    block_rq_wr_enabled = 0;
    block_rq_rd_enabled = 0;
}
static void gator_events_meminfo_stop(void)
{
	if (meminfo_global_enabled) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
		GATOR_UNREGISTER_TRACE(mm_page_free_direct);
		GATOR_UNREGISTER_TRACE(mm_pagevec_free);
#else
		GATOR_UNREGISTER_TRACE(mm_page_free);
		GATOR_UNREGISTER_TRACE(mm_page_free_batched);
#endif
		GATOR_UNREGISTER_TRACE(mm_page_alloc);

#if USE_THREAD
		/* Stop worker thread */
		gator_meminfo_run = false;
		up(&gator_meminfo_sem);
#else
		del_timer_sync(&meminfo_wake_up_timer);
#endif
	}
}
예제 #10
0
static void gator_events_mali_stop(void) {
    unsigned int cnt;

    pr_debug("gator: mali stop\n");

    if (trace_registered) {
        GATOR_UNREGISTER_TRACE(mali_hw_counter);
        GATOR_UNREGISTER_TRACE(mali_sw_counter);
    
        pr_debug("gator: mali timeline tracepoint deactivated\n");
        
        trace_registered = 0;
    }

    for (cnt = FIRST_ACTIVITY_EVENT; cnt < NUMBER_OF_EVENTS; cnt++) {
        counter_enabled[cnt] = 0;
        counter_event[cnt] = 0;
        counter_address[cnt] = NULL;
    }

    mali_counter_deinitialize();
}
예제 #11
0
static void stop(void)
{
    pr_debug("gator: Mali-T6xx: stop\n");

    /*
     * It is safe to unregister traces even if they were not successfully
     * registered, so no need to check.
     */
    GATOR_UNREGISTER_TRACE(mali_pm_status);
    pr_debug("gator: Mali-T6xx: mali_pm_status tracepoint deactivated\n");

    GATOR_UNREGISTER_TRACE(mali_page_fault_insert_pages);
    pr_debug("gator: Mali-T6xx: mali_page_fault_insert_pages tracepoint deactivated\n");

    GATOR_UNREGISTER_TRACE(mali_mmu_as_in_use);
    pr_debug("gator: Mali-T6xx: mali_mmu_as_in_use tracepoint deactivated\n");

    GATOR_UNREGISTER_TRACE(mali_mmu_as_released);
    pr_debug("gator: Mali-T6xx: mali_mmu_as_released tracepoint deactivated\n");

    GATOR_UNREGISTER_TRACE(mali_total_alloc_pages_change);
    pr_debug("gator: Mali-T6xx: mali_total_alloc_pages_change tracepoint deactivated\n");
}
예제 #12
0
static int gator_events_irq_start(void)
{
	// register tracepoints
	if (hardirq_enabled)
		if (GATOR_REGISTER_TRACE(irq_handler_exit))
			goto fail_hardirq_exit;
	if (softirq_enabled)
		if (GATOR_REGISTER_TRACE(softirq_exit))
			goto fail_softirq_exit;
	pr_debug("gator: registered irq tracepoints\n");

	return 0;

	// unregister tracepoints on error
fail_softirq_exit:
	if (hardirq_enabled)
		GATOR_UNREGISTER_TRACE(irq_handler_exit);
fail_hardirq_exit:
	pr_err("gator: irq tracepoints failed to activate, please verify that tracepoints are enabled in the linux kernel\n");

	return -1;
}
예제 #13
0
static void gator_migrate_stop(void)
{
	GATOR_UNREGISTER_TRACE(cpu_migrate_current);
	GATOR_UNREGISTER_TRACE(cpu_migrate_finish);
	GATOR_UNREGISTER_TRACE(cpu_migrate_begin);
}