From 4b8bb1145480d94dc7029d17acabc77da02a6c3b Mon Sep 17 00:00:00 2001 From: Ken Steele Date: Tue, 27 Aug 2013 17:04:07 -0400 Subject: [PATCH] Enable using Tile cycle counter. The Tile processors all have a cycle counter with a simple interface. Use that for UtilCpuGetTicks. --- src/util-cpu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/util-cpu.c b/src/util-cpu.c index 18cc12151f..c8559533a9 100644 --- a/src/util-cpu.c +++ b/src/util-cpu.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007-2010 Open Information Security Foundation +/* Copyright (C) 2007-2013 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free @@ -175,6 +175,13 @@ void UtilCpuPrintSummary() { * \todo We'll have to deal with removig ticks from the extra cpuids inbetween * 2 calls. */ +#if defined(__tile__) +#include +uint64_t UtilCpuGetTicks(void) +{ + return get_cycle_count(); +} +#else uint64_t UtilCpuGetTicks(void) { uint64_t val; @@ -217,3 +224,4 @@ uint64_t UtilCpuGetTicks(void) #endif return val; } +#endif /* __tile__ */