Adrian Hunter | 5efb1d5 | 2015-07-17 19:33:42 +0300 | [diff] [blame] | 1 | /* |
| 2 | * auxtrace.c: AUX area tracing support |
| 3 | * Copyright (c) 2013-2014, Intel Corporation. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms and conditions of the GNU General Public License, |
| 7 | * version 2, as published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 12 | * more details. |
| 13 | * |
| 14 | */ |
| 15 | |
| 16 | #include "../../util/header.h" |
| 17 | #include "../../util/auxtrace.h" |
| 18 | #include "../../util/intel-pt.h" |
| 19 | |
| 20 | struct auxtrace_record *auxtrace_record__init(struct perf_evlist *evlist __maybe_unused, |
| 21 | int *err) |
| 22 | { |
| 23 | char buffer[64]; |
| 24 | int ret; |
| 25 | |
| 26 | *err = 0; |
| 27 | |
| 28 | ret = get_cpuid(buffer, sizeof(buffer)); |
| 29 | if (ret) { |
| 30 | *err = ret; |
| 31 | return NULL; |
| 32 | } |
| 33 | |
| 34 | if (!strncmp(buffer, "GenuineIntel,", 13)) |
| 35 | return intel_pt_recording_init(err); |
| 36 | |
| 37 | return NULL; |
| 38 | } |