btrace: identify cpu

Add a struct for identifying a processor and use it in linux-btrace.c when
identifying the processor we're running on.

We will need this feature for the new btrace format.

2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>

	* common/btrace-common.h (btrace_cpu_vendor, btrace_cpu): New.
	* nat/linux-btrace.c: (btrace_this_cpu): New.
	(cpu_supports_bts): Call btrace_this_cpu.
	(intel_supports_bts): Add cpu parameter.
This commit is contained in:
Markus Metzger
2014-02-14 09:25:40 +01:00
parent 7d5c24b3ae
commit afb778a2a8
3 changed files with 83 additions and 22 deletions

View File

@@ -61,6 +61,34 @@ enum btrace_format
BTRACE_FORMAT_BTS
};
/* An enumeration of cpu vendors. */
enum btrace_cpu_vendor
{
/* We do not know this vendor. */
CV_UNKNOWN,
/* Intel. */
CV_INTEL
};
/* A cpu identifier. */
struct btrace_cpu
{
/* The processor vendor. */
enum btrace_cpu_vendor vendor;
/* The cpu family. */
unsigned short family;
/* The cpu model. */
unsigned char model;
/* The cpu stepping. */
unsigned char stepping;
};
/* A BTS configuration. */
struct btrace_config_bts