diff options
Diffstat (limited to 'tools/perf/util/expr.c')
| -rw-r--r-- | tools/perf/util/expr.c | 13 | 
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c index 675f318ce7c1..c15a9852fa41 100644 --- a/tools/perf/util/expr.c +++ b/tools/perf/util/expr.c @@ -12,6 +12,7 @@  #include "expr-bison.h"  #include "expr-flex.h"  #include "smt.h" +#include "tsc.h"  #include <linux/err.h>  #include <linux/kernel.h>  #include <linux/zalloc.h> @@ -402,6 +403,13 @@ double expr_id_data__source_count(const struct expr_id_data *data)  	return data->val.source_count;  } +#if !defined(__i386__) && !defined(__x86_64__) +double arch_get_tsc_freq(void) +{ +	return 0.0; +} +#endif +  double expr__get_literal(const char *literal)  {  	static struct cpu_topology *topology; @@ -417,6 +425,11 @@ double expr__get_literal(const char *literal)  		goto out;  	} +	if (!strcasecmp("#system_tsc_freq", literal)) { +		result = arch_get_tsc_freq(); +		goto out; +	} +  	/*  	 * Assume that topology strings are consistent, such as CPUs "0-1"  	 * wouldn't be listed as "0,1", and so after deduplication the number of  | 
