dtrace with driver built using cmake

raghunath nayak 1 Reputation point
2021-12-23T20:27:19.687+00:00

Hi,

I have installed dtrace on windows 10 Insider build and it is working fine in general.

I built and loaded a driver from https://github.com/openzfsonwindows/openzfs. The project is build using cmake. The static libraries are compiled with clang-cl.exe and linked with driver file compiled with msvc(cl.exe). When listing the fbt probes with dtrace, it is listing only the functions 'entry' probes but not listing the function 'return' probe names. Any additional compile flags to be passed in the cmake for resolving this? Thanks.

C:\Program Files\DTrace>dtrace.exe -ln "fbt:openzfs::"
ID PROVIDER MODULE FUNCTION NAME
7281 fbt openzfs taskq_dispatch_delay entry
7282 fbt openzfs taskq_cancel_id entry
7283 fbt openzfs taskq_start_delay_thread entry
7284 fbt openzfs askq_delay_dispatcher_thread entry
7285 fbt openzfs taskq_stop_delay_thread entry
7286 fbt openzfs spl_taskq_init entry
...................
....................

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
783 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,053 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,611 Reputation points
    2021-12-27T18:04:02.257+00:00

    Use the /DRIVER linker option to build a Windows NT kernel mode driver.

    /DRIVER:UPONLY causes the linker to add the IMAGE_FILE_UP_SYSTEM_ONLY bit to the characteristics in the output header to specify that it is a uniprocessor (UP) driver. The operating system will refuse to load a UP driver on a multiprocessor (MP) system.

    /DRIVER:WDM causes the linker to set the IMAGE_DLLCHARACTERISTICS_WDM_DRIVER bit in the optional header's DllCharacteristics field.

    You can dig more from here https://video2.skills-academy.com/en-us/cpp/build/reference/driver-windows-nt-kernel-mode-driver?view=msvc-160

    Hope this resolves your Query!!

    ----

    --If the reply is helpful, please Upvote and Accept it as an answer--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.