Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ivyl/igt
  • rodrigovivi/igt-gpu-tools
  • sima/igt-gpu-tools
  • adrinael/igt-gpu-tools
  • mvlad/igt-gpu-tools
  • mupuf/igt-gpu-tools
  • alatiera/igt-gpu-tools
  • strassek/igt-gpu-tools
  • ayan.halder/igt-gpu-tools
  • tomba/igt-gpu-tools
  • tomeu/igt-gpu-tools
  • robh/igt-gpu-tools
  • tpm/igt-gpu-tools
  • demarchi/igt-gpu-tools
  • lyudess/igt-gpu-tools
  • xyliu/igt-gpu-tools
  • bosheng/igt-gpu-tools
  • emersion/igt-gpu-tools
  • gtucker/igt-gpu-tools
  • omrigan/igt-gpu-tools
  • mtolakan/igt-gpu-tools
  • Acidburn0zzz/igt-gpu-tools
  • renchenglei/igt-gpu-tools
  • trimagiccube/igt-gpu-tools
  • haihao/igt-gpu-tools
  • antonovitch/igt-gpu-tools
  • aknautiyal/igt-gpu-tools
  • jani/igt-gpu-tools
  • xexaxo/igt-gpu-tools
  • llandwerlin/igt-gpu-tools
  • daniels/igt-gpu-tools
  • alyssa/igt-gpu-tools
  • nchery/igt-gpu-tools
  • sagarghuge/igt-gpu-tools
  • knljoshi98/igt-gpu-tools
  • shadeslayer/igt-gpu-tools
  • agners/igt-gpu-tools
  • lfiedoro/igt-gpu-tools
  • jcline/igt-gpu-tools
  • stanelyintel/igt-gpu-tools
  • sameer.lattannavar/igt-gpu-tools
  • tzimmermann/igt-gpu-tools
  • zxye/igt-gpu-tools
  • alan_previn_intel/igt-gpu-tools
  • linkmauve/igt-gpu-tools
  • nroberts/igt-gpu-tools
  • agrodzov/igt-gpu-tools
  • rpurdie/igt-gpu-tools
  • kraj/igt-gpu-tools
  • gfxstrand/igt-gpu-tools
  • mcasas/igt-gpu-tools
  • bbrezillon/igt-gpu-tools
  • isinyaaa/igt-gpu-tools
  • hwentland/igt-gpu-tools
  • vitalyp/igt-gpu-tools
  • tales-aparecida/igt-gpu-tools
  • saigowth/igt-gpu-tools
  • bmodem/igt-gpu-tools
58 results
Show changes
Commits on Source (3)
......@@ -1050,6 +1050,11 @@ xe_eudebug_read_event(int fd, struct drm_xe_eudebug_event *event)
return ret;
}
static void terminate_debugger(int sig)
{
pthread_exit(NULL);
}
static void *debugger_worker_loop(void *data)
{
uint8_t buf[MAX_EVENT_SIZE];
......@@ -1060,9 +1065,14 @@ static void *debugger_worker_loop(void *data)
.revents = 0,
};
int timeout_ms = 100, ret;
struct sigaction sa = { 0 };
igt_assert(d->master_fd >= 0);
igt_assert_eq(sigaction(SIGINT, NULL, &sa), 0);
sa.sa_handler = terminate_debugger;
igt_assert_eq(sigaction(SIGINT, &sa, NULL), 0);
do {
p.fd = d->fd;
ret = poll(&p, 1, timeout_ms);
......@@ -1440,12 +1450,16 @@ void xe_eudebug_client_stop(struct xe_eudebug_client *c)
{
if (c->pid) {
int waitstatus;
int ret;
xe_eudebug_client_wait_done(c);
token_signal(c->p_in, CLIENT_STOP, c->pid);
igt_assert_eq(waitpid(c->pid, &waitstatus, 0),
c->pid);
ret = waitpid(c->pid, &waitstatus, 0);
/* process may be gone already */
if (!(ret == -1 && errno == ECHILD))
igt_assert_eq(ret, c->pid);
c->pid = 0;
}
}
......
......@@ -1509,6 +1509,98 @@ static void test_set_breakpoint_online(int fd, struct drm_xe_engine_class_instan
online_debug_data_destroy(data);
}
/**
* SUBTEST: set-breakpoint-sigint-debugger
* Description:
* A variant of set-breakpoint that sends SIGINT to the debugger thread with random timing
* and checks if nothing breaks, exercising the scenario multiple times.
*/
static void test_set_breakpoint_online_sigint_debugger(int fd,
struct drm_xe_engine_class_instance *hwe,
int flags)
{
struct xe_eudebug_session *s;
struct online_debug_data *data;
struct timespec ts = { };
int loop_count = 0;
uint64_t sleep_time;
uint64_t set_breakpoint_time;
uint64_t max_sleep_time;
uint64_t events_max = 0;
int sigints_during_test = 0;
/*
* Measure the average time required for basic set-breakpoint variant,
* so sleep_time range is correct.
*/
igt_nsec_elapsed(&ts);
for (int i = 0; i < 10; i++)
test_set_breakpoint_online(fd, hwe, SHADER_NOP | TRIGGER_UFENCE_SET_BREAKPOINT);
set_breakpoint_time = igt_nsec_elapsed(&ts) / (NSEC_PER_MSEC / USEC_PER_MSEC) / 10;
igt_info("Average set-breakpoint execution time: %" PRIu64 " us\n", set_breakpoint_time);
max_sleep_time = set_breakpoint_time * 11 / 10;
igt_info("Maximum sleep_time: %" PRIu64 " us\n", max_sleep_time);
ts = (struct timespec) { };
igt_nsec_elapsed(&ts);
while (igt_seconds_elapsed(&ts) < 60) {
uint64_t event_count;
sleep_time = rand() % max_sleep_time;
igt_debug("Loop %d: SIGINT after %" PRIu64 " us\n", loop_count, sleep_time);
data = online_debug_data_create(hwe);
s = xe_eudebug_session_create(fd, run_online_client, flags, data);
xe_eudebug_debugger_add_trigger(s->debugger, DRM_XE_EUDEBUG_EVENT_OPEN,
open_trigger);
xe_eudebug_debugger_add_trigger(s->debugger, DRM_XE_EUDEBUG_EVENT_EXEC_QUEUE,
exec_queue_trigger);
xe_eudebug_debugger_add_trigger(s->debugger, DRM_XE_EUDEBUG_EVENT_VM,
vm_open_trigger);
xe_eudebug_debugger_add_trigger(s->debugger, DRM_XE_EUDEBUG_EVENT_METADATA,
create_metadata_trigger);
xe_eudebug_debugger_add_trigger(s->debugger, DRM_XE_EUDEBUG_EVENT_VM_BIND_UFENCE,
ufence_ack_set_bp_trigger);
xe_eudebug_debugger_add_trigger(s->debugger, DRM_XE_EUDEBUG_EVENT_EU_ATTENTION,
eu_attention_resume_trigger);
igt_assert_eq(xe_eudebug_debugger_attach(s->debugger, s->client), 0);
xe_eudebug_debugger_start_worker(s->debugger);
igt_assert_eq(READ_ONCE(s->debugger->event_count), 0);
xe_eudebug_client_start(s->client);
/* Sample max events without SIGINT */
if (!loop_count++)
xe_eudebug_client_wait_done(s->client);
else
usleep(sleep_time);
event_count = READ_ONCE(s->debugger->event_count);
if (event_count > events_max)
events_max = event_count;
else if (event_count > 0 && event_count < events_max)
sigints_during_test++;
igt_assert_eq(pthread_kill(s->debugger->worker_thread, SIGINT), 0);
close(s->debugger->fd);
igt_assert_eq(READ_ONCE(s->debugger->worker_state), DEBUGGER_WORKER_ACTIVE);
WRITE_ONCE(s->debugger->worker_state, DEBUGGER_WORKER_INACTIVE);
xe_eudebug_client_wait_done(s->client);
xe_eudebug_event_log_print(s->debugger->log, true);
xe_eudebug_event_log_print(s->client->log, true);
xe_eudebug_session_destroy(s);
online_debug_data_destroy(data);
}
igt_info("%d correctly timed SIGINTs in %d loops\n", sigints_during_test, loop_count);
igt_assert_lt(0, sigints_during_test);
}
/**
* SUBTEST: pagefault-read
* Description:
......@@ -2429,6 +2521,10 @@ igt_main
test_gt_render_or_compute("set-breakpoint", fd, hwe)
test_set_breakpoint_online(fd, hwe, SHADER_NOP | TRIGGER_UFENCE_SET_BREAKPOINT);
test_gt_render_or_compute("set-breakpoint-sigint-debugger", fd, hwe)
test_set_breakpoint_online_sigint_debugger(fd, hwe,
SHADER_NOP | TRIGGER_UFENCE_SET_BREAKPOINT);
test_gt_render_or_compute("breakpoint-not-in-debug-mode", fd, hwe)
test_basic_online(fd, hwe, SHADER_BREAKPOINT | DISABLE_DEBUG_MODE);
......