+2017-12-07 Yao Qi <yao.qi@linaro.org>
+
+ * linux-aarch64-ipa.c (initialize_low_tracepoint): Call
+ aarch64_linux_read_description.
+ * linux-amd64-ipa.c (idx2mask): New array.
+ (get_ipa_tdesc): Move idx2mask out.
+ (initialize_low_tracepoint): Initialize target descriptions.
+ * linux-i386-ipa.c (idx2mask): New array.
+ (get_ipa_tdesc): Move idx2mask out.
+ (initialize_low_tracepoint): Initialize target descriptions.
+
2017-12-05 Simon Marchi <simon.marchi@polymtl.ca>
* tdesc.c (struct tdesc_type): Change return type.
void
initialize_low_tracepoint (void)
{
+ aarch64_linux_read_description ();
}
#endif /* HAVE_UST */
+#if !defined __ILP32__
+/* Map the tdesc index to xcr0 mask. */
+static uint64_t idx2mask[X86_TDESC_LAST] = {
+ X86_XSTATE_X87_MASK,
+ X86_XSTATE_SSE_MASK,
+ X86_XSTATE_AVX_MASK,
+ X86_XSTATE_MPX_MASK,
+ X86_XSTATE_AVX_MPX_MASK,
+ X86_XSTATE_AVX_AVX512_MASK,
+ X86_XSTATE_AVX_MPX_AVX512_PKU_MASK,
+};
+#endif
+
/* Return target_desc to use for IPA, given the tdesc index passed by
gdbserver. */
break;
}
#else
- /* Map the tdesc index to xcr0 mask. */
- uint64_t idx2mask[X86_TDESC_LAST] = {
- X86_XSTATE_X87_MASK,
- X86_XSTATE_SSE_MASK,
- X86_XSTATE_AVX_MASK,
- X86_XSTATE_MPX_MASK,
- X86_XSTATE_AVX_MPX_MASK,
- X86_XSTATE_AVX_AVX512_MASK,
- X86_XSTATE_AVX_MPX_AVX512_PKU_MASK,
- };
-
return amd64_linux_read_description (idx2mask[idx], false);
#endif
void
initialize_low_tracepoint (void)
{
+#if defined __ILP32__
+ amd64_linux_read_description (X86_XSTATE_SSE_MASK, true);
+ amd64_linux_read_description (X86_XSTATE_AVX_MASK, true);
+ amd64_linux_read_description (X86_XSTATE_AVX_AVX512_MASK, true);
+#else
+ for (auto i = 0; i < X86_TDESC_LAST; i++)
+ amd64_linux_read_description (idx2mask[i], false);
+#endif
}
}
}
+/* Map the tdesc index to xcr0 mask. */
+static uint64_t idx2mask[X86_TDESC_LAST] = {
+ X86_XSTATE_X87_MASK,
+ X86_XSTATE_SSE_MASK,
+ X86_XSTATE_AVX_MASK,
+ X86_XSTATE_MPX_MASK,
+ X86_XSTATE_AVX_MPX_MASK,
+ X86_XSTATE_AVX_AVX512_MASK,
+ X86_XSTATE_AVX_MPX_AVX512_PKU_MASK,
+};
+
/* Return target_desc to use for IPA, given the tdesc index passed by
gdbserver. */
internal_error (__FILE__, __LINE__,
"unknown ipa tdesc index: %d", idx);
}
-
- /* Map the tdesc index to xcr0 mask. */
- uint64_t idx2mask[X86_TDESC_LAST] = {
- X86_XSTATE_X87_MASK,
- X86_XSTATE_SSE_MASK,
- X86_XSTATE_AVX_MASK,
- X86_XSTATE_MPX_MASK,
- X86_XSTATE_AVX_MPX_MASK,
- X86_XSTATE_AVX_AVX512_MASK,
- X86_XSTATE_AVX_MPX_AVX512_PKU_MASK,
- };
-
return i386_linux_read_description (idx2mask[idx]);
}
initialize_low_tracepoint (void)
{
initialize_fast_tracepoint_trampoline_buffer ();
+ for (auto i = 0; i < X86_TDESC_LAST; i++)
+ i386_linux_read_description (idx2mask[i]);
}
+2017-12-07 Yao Qi <yao.qi@linaro.org>
+
+ * gdb.trace/ftrace.exp (run_trace_experiment): Set breakpoint on
+ malloc and catch syscall.
+
2017-12-07 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-breakpoint.exp (test_bkpt_explicit_loc): Add new
gdb_test_no_output "tstart" "start trace experiment"
- gdb_test "continue" \
- ".*Breakpoint \[0-9\]+, end .*" \
- "advance through tracing"
+ # Fast tracepoint can be set in signal handler, so gdb_collect in
+ # IPA shouldn't call any non-async-signal-safe functions. It is
+ # impractical to list all non-async-signal-safe functions, and set
+ # breakpoints on them, so choose malloc only in this test.
+ gdb_test "b -q malloc"
+
+ # Performance-wise, gdb_collect in IPA shouldn't call any syscall
+ # in order to keep fast tracepoint fast enough.
+ global gdb_prompt
+ set test "catch syscall"
+ gdb_test_multiple $test $test {
+ -re "The feature \'catch syscall\' is not supported.*\r\n$gdb_prompt $" {
+ }
+ -re ".*$gdb_prompt $" {
+ pass $test
+ }
+ }
+
+ global decimal
+ set test "advance through tracing"
+ gdb_test_multiple "continue" $test {
+ -re "Thread 2 .* hit Catchpoint $decimal \\(call to syscall .*\\).*\r\n$gdb_prompt $" {
+ # IPA starts a helper thread, which calls accept. Ignore it.
+ send_gdb "continue\n"
+ exp_continue
+ }
+ -re "Breakpoint $decimal, end .*$gdb_prompt $" {
+ pass $test
+ }
+ }
gdb_test "tstatus" ".*Trace .*" "check on trace status"