/**
- * Copyright (C) ARM Limited 2010-2014. All rights reserved.
+ * Copyright (C) ARM Limited 2010-2015. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
{
unsigned long flags;
- // disable interrupts to synchronize with gator_events_sched_read()
- // spinlocks not needed since percpu buffers are used
+ /* disable interrupts to synchronize with gator_events_sched_read()
+ * spinlocks not needed since percpu buffers are used
+ */
local_irq_save(flags);
per_cpu(schedCnt, get_physical_cpu())[SCHED_SWITCH]++;
local_irq_restore(flags);
/* switch */
dir = gatorfs_mkdir(sb, root, "Linux_sched_switch");
- if (!dir) {
+ if (!dir)
return -1;
- }
gatorfs_create_ulong(sb, dir, "enabled", &sched_switch_enabled);
gatorfs_create_ro_ulong(sb, dir, "key", &sched_switch_key);
static int gator_events_sched_start(void)
{
- // register tracepoints
+ /* register tracepoints */
if (sched_switch_enabled)
if (GATOR_REGISTER_TRACE(sched_switch))
goto sched_switch_exit;
return 0;
- // unregister tracepoints on error
+ /* unregister tracepoints on error */
sched_switch_exit:
pr_err("gator: scheduler event tracepoints failed to activate, please verify that tracepoints are enabled in the linux kernel\n");
sched_switch_enabled = 0;
}
-static int gator_events_sched_read(int **buffer)
+static int gator_events_sched_read(int **buffer, bool sched_switch)
{
unsigned long flags;
int len, value;