]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common: Add Windows ETW support
authorAlin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Mon, 16 Nov 2020 22:36:36 +0000 (00:36 +0200)
committerAlin Gabriel Serdean <aserdean@ovn.org>
Tue, 9 Feb 2021 08:46:24 +0000 (10:46 +0200)
commit8e7042f4ca2872c187c7dd1ffa679453ec86e610
tree15d5e8d542eb80d3980e368521dec6a19bcd5db7
parent9ab1b5cb6565ddff3d684fd83a3d9c5900360c77
common: Add Windows ETW support

This patch adds generic ETW logging on top of syslog calls.

The events are described in the message compiler file `event_logging.mc`.

Using the cross platform utility `windmc`, we will generate the header file,
`event_logging.h`, needed by the ETW implementation, and the resource file
`event_logging.rc`.

Over the generated resource file we will run another utility called `windres`.
this tool is used to compile the binary objects needed by the OS utilities
(i.e. `Event Viewer`) to view the logged events.

On usage, a registry key needs to be added/removed on the target computer.
The registry looks like the following:
[HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\<get_process_name>]
"EventMessageFile"="<Folder_location_to>\\event_logging.dll"

I.E.:
[HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\rbd-wnbd]
"EventMessageFile"="C:\\Program Files\\Ceph\\bin\\event_logging.dll"

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
Co-authored-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/common/CMakeLists.txt
src/common/win32/event_logging.mc [new file with mode: 0644]
src/common/win32/syslog.cc [new file with mode: 0644]
src/include/win32/syslog.h