Improve printing ioctls entries

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2021-05-12 07:42:33 +00:00 committed by Compute-Runtime-Automation
parent 085a2af2d6
commit 3c9dcbb1db
2 changed files with 3 additions and 3 deletions

View File

@ -171,7 +171,7 @@ TEST(DrmTest, givenPrintIoctlEntriesWhenCallIoctlThenIoctlIsPrinted) {
drm->destroyDrmContext(contextId);
std::string output = ::testing::internal::GetCapturedStdout();
EXPECT_STREQ(output.c_str(), "IOCTL 1074291822 called\nIOCTL 1074291822 returns 0, errno 9\n");
EXPECT_STREQ(output.c_str(), "IOCTL DRM_IOCTL_I915_GEM_CONTEXT_DESTROY called\nIOCTL DRM_IOCTL_I915_GEM_CONTEXT_DESTROY returns 0, errno 9\n");
}
TEST(DrmTest, givenPrintIoctlTimesWhenCallIoctlThenStatisticsAreGathered) {

View File

@ -80,13 +80,13 @@ int Drm::ioctl(unsigned long request, void *arg) {
auto printIoctl = DebugManager.flags.PrintIoctlEntries.get();
if (printIoctl) {
printf("IOCTL %lu called\n", request);
printf("IOCTL %s called\n", this->ioctlToString(request).c_str());
}
ret = SysCalls::ioctl(getFileDescriptor(), request, arg);
if (printIoctl) {
printf("IOCTL %lu returns %d, errno %d\n", request, ret, errno);
printf("IOCTL %s returns %d, errno %d\n", this->ioctlToString(request).c_str(), ret, errno);
}
if (measureTime) {