Lines Matching +full:static +full:- +full:config

2  * Copyright (c) 2014-2019, Intel Corporation
31 #include "intel-pt.h"
40 struct pt_config config; member
53 static struct ptunit_result tfix_init(struct time_fixture *tfix) in tfix_init()
55 memset(&tfix->config, 0, sizeof(tfix->config)); in tfix_init()
56 tfix->config.size = sizeof(tfix->config); in tfix_init()
57 tfix->config.cpuid_0x15_eax = 2; in tfix_init()
58 tfix->config.cpuid_0x15_ebx = 1; in tfix_init()
59 tfix->config.mtc_freq = 4; in tfix_init()
61 pt_tcal_init(&tfix->tcal); in tfix_init()
62 pt_tcal_set_fcr(&tfix->tcal, 0x2ull << pt_tcal_fcr_shr); in tfix_init()
64 pt_time_init(&tfix->time); in tfix_init()
70 static struct ptunit_result tsc_null(struct time_fixture *tfix) in tsc_null()
75 errcode = pt_time_update_tsc(NULL, &packet, &tfix->config); in tsc_null()
76 ptu_int_eq(errcode, -pte_internal); in tsc_null()
78 errcode = pt_time_update_tsc(&tfix->time, NULL, &tfix->config); in tsc_null()
79 ptu_int_eq(errcode, -pte_internal); in tsc_null()
84 static struct ptunit_result cbr_null(struct time_fixture *tfix) in cbr_null()
89 errcode = pt_time_update_cbr(NULL, &packet, &tfix->config); in cbr_null()
90 ptu_int_eq(errcode, -pte_internal); in cbr_null()
92 errcode = pt_time_update_cbr(&tfix->time, NULL, &tfix->config); in cbr_null()
93 ptu_int_eq(errcode, -pte_internal); in cbr_null()
98 static struct ptunit_result tma_null(struct time_fixture *tfix) in tma_null()
103 errcode = pt_time_update_tma(NULL, &packet, &tfix->config); in tma_null()
104 ptu_int_eq(errcode, -pte_internal); in tma_null()
106 errcode = pt_time_update_tma(&tfix->time, NULL, &tfix->config); in tma_null()
107 ptu_int_eq(errcode, -pte_internal); in tma_null()
109 errcode = pt_time_update_tma(&tfix->time, &packet, NULL); in tma_null()
110 ptu_int_eq(errcode, -pte_internal); in tma_null()
115 static struct ptunit_result mtc_null(struct time_fixture *tfix) in mtc_null()
120 errcode = pt_time_update_mtc(NULL, &packet, &tfix->config); in mtc_null()
121 ptu_int_eq(errcode, -pte_internal); in mtc_null()
123 errcode = pt_time_update_mtc(&tfix->time, NULL, &tfix->config); in mtc_null()
124 ptu_int_eq(errcode, -pte_internal); in mtc_null()
126 errcode = pt_time_update_mtc(&tfix->time, &packet, NULL); in mtc_null()
127 ptu_int_eq(errcode, -pte_internal); in mtc_null()
132 static struct ptunit_result cyc_null(struct time_fixture *tfix) in cyc_null()
137 errcode = pt_time_update_cyc(NULL, &packet, &tfix->config, 0ull); in cyc_null()
138 ptu_int_eq(errcode, -pte_internal); in cyc_null()
140 errcode = pt_time_update_cyc(&tfix->time, NULL, &tfix->config, 0ull); in cyc_null()
141 ptu_int_eq(errcode, -pte_internal); in cyc_null()
143 errcode = pt_time_update_cyc(&tfix->time, &packet, NULL, 0ull); in cyc_null()
144 ptu_int_eq(errcode, -pte_internal); in cyc_null()
149 static struct ptunit_result query_tsc_null(struct time_fixture *tfix) in query_tsc_null()
154 errcode = pt_time_query_tsc(NULL, NULL, NULL, &tfix->time); in query_tsc_null()
155 ptu_int_eq(errcode, -pte_internal); in query_tsc_null()
158 ptu_int_eq(errcode, -pte_internal); in query_tsc_null()
163 static struct ptunit_result query_tsc_none(struct time_fixture *tfix) in query_tsc_none()
168 errcode = pt_time_query_tsc(&tsc, NULL, NULL, &tfix->time); in query_tsc_none()
169 ptu_int_eq(errcode, -pte_no_time); in query_tsc_none()
174 static struct ptunit_result query_cbr_null(struct time_fixture *tfix) in query_cbr_null()
179 errcode = pt_time_query_cbr(NULL, &tfix->time); in query_cbr_null()
180 ptu_int_eq(errcode, -pte_internal); in query_cbr_null()
183 ptu_int_eq(errcode, -pte_internal); in query_cbr_null()
188 static struct ptunit_result query_cbr_none(struct time_fixture *tfix) in query_cbr_none()
193 errcode = pt_time_query_cbr(&cbr, &tfix->time); in query_cbr_none()
194 ptu_int_eq(errcode, -pte_no_cbr); in query_cbr_none()
199 static struct ptunit_result tcal_cbr_null(struct time_fixture *tfix) in tcal_cbr_null()
204 errcode = pt_tcal_update_cbr(NULL, &packet, &tfix->config); in tcal_cbr_null()
205 ptu_int_eq(errcode, -pte_internal); in tcal_cbr_null()
210 static struct ptunit_result tcal_cbr_zero(struct time_fixture *tfix) in tcal_cbr_zero()
213 struct pt_config config; in tcal_cbr_zero() local
216 config = tfix->config; in tcal_cbr_zero()
217 config.nom_freq = 1; in tcal_cbr_zero()
220 errcode = pt_tcal_update_cbr(&tfix->tcal, &packet, &config); in tcal_cbr_zero()
221 ptu_int_eq(errcode, -pte_bad_packet); in tcal_cbr_zero()
226 static struct ptunit_result tcal_mtc_null(struct time_fixture *tfix) in tcal_mtc_null()
231 errcode = pt_tcal_update_mtc(NULL, &packet, &tfix->config); in tcal_mtc_null()
232 ptu_int_eq(errcode, -pte_internal); in tcal_mtc_null()
234 errcode = pt_tcal_update_mtc(&tfix->tcal, NULL, &tfix->config); in tcal_mtc_null()
235 ptu_int_eq(errcode, -pte_internal); in tcal_mtc_null()
237 errcode = pt_tcal_update_mtc(&tfix->tcal, &packet, NULL); in tcal_mtc_null()
238 ptu_int_eq(errcode, -pte_internal); in tcal_mtc_null()
243 static struct ptunit_result tcal_cyc_null(struct time_fixture *tfix) in tcal_cyc_null()
248 errcode = pt_tcal_update_cyc(NULL, &packet, &tfix->config); in tcal_cyc_null()
249 ptu_int_eq(errcode, -pte_internal); in tcal_cyc_null()
251 errcode = pt_tcal_update_cyc(&tfix->tcal, NULL, &tfix->config); in tcal_cyc_null()
252 ptu_int_eq(errcode, -pte_internal); in tcal_cyc_null()
257 static struct ptunit_result tsc(struct time_fixture *tfix) in tsc()
266 errcode = pt_time_update_tsc(&tfix->time, &packet, &tfix->config); in tsc()
269 errcode = pt_time_query_tsc(&tsc, &lost_mtc, &lost_cyc, &tfix->time); in tsc()
279 static struct ptunit_result cbr(struct time_fixture *tfix) in cbr()
287 errcode = pt_time_update_cbr(&tfix->time, &packet, &tfix->config); in cbr()
290 errcode = pt_time_query_cbr(&cbr, &tfix->time); in cbr()
298 static struct ptunit_result cbr_zero(struct time_fixture *tfix) in cbr_zero()
305 errcode = pt_time_update_cbr(&tfix->time, &packet, &tfix->config); in cbr_zero()
306 ptu_int_eq(errcode, -pte_bad_packet); in cbr_zero()
311 static struct ptunit_result tma(struct time_fixture *tfix) in tma()
319 errcode = pt_time_update_tma(&tfix->time, &packet, &tfix->config); in tma()
320 ptu_int_eq(errcode, -pte_bad_context); in tma()
325 static struct ptunit_result mtc(struct time_fixture *tfix) in mtc()
333 errcode = pt_time_update_mtc(&tfix->time, &packet, &tfix->config); in mtc()
336 errcode = pt_time_query_tsc(&tsc, NULL, NULL, &tfix->time); in mtc()
337 ptu_int_eq(errcode, -pte_no_time); in mtc()
342 static struct ptunit_result cyc(struct time_fixture *tfix) in cyc()
348 errcode = pt_tcal_fcr(&fcr, &tfix->tcal); in cyc()
353 errcode = pt_time_update_cyc(&tfix->time, &packet, &tfix->config, fcr); in cyc()
356 errcode = pt_time_query_tsc(&tsc, NULL, NULL, &tfix->time); in cyc()
357 ptu_int_eq(errcode, -pte_no_time); in cyc()