-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vioscsi] Implement cold and hot tracing paths #1228
base: master
Are you sure you want to change the base?
[vioscsi] Implement cold and hot tracing paths #1228
Conversation
1. Introduced three (3) compile-time environment variables: RUN_WPP_ALL_PATHS - Compile WPP for the hot path too. Is the inverse of RUN_COLD_PATH_ONLY, which is the default behaviour. FORCE_RUN_UNCHECKED - Run without EVENT_TRACING or DBG. Defines RUN_UNCHECKED. FORCE_RUN_DEBUG - Run with DBG rather than EVENT_TRACING. Undefines EVENT_TRACING. 2. WPP scans for WPP config on a per file basis. Sections of the config file cannot be excluded and conditional macros will be ignored. To solve this, we establish two new files with WPP configuration data. One holds exclusively cold path data (wpp_cold_path.h) and the other holds data for all paths (wpp_all_paths.h). Which file to use is set conditionally per the vioscsi.vcxproj project file configuration. 3. The hot path DBG and WPP macro variants are a clone of the cold path macros, but with a "_HP" suffix. The exception to this is RhelDbgPrint() which we extend as RhelDbgPrintHotPath(). 4. Encapsulated exisitng cold and and hot trace messages in compile-time conditional macros and in same manner drops *.tmh includes when necessary. 5. Minor refactoring of: a) helper.c - GetScsiConfig() b) helper.c - SetGuestFeatures() 6. Major refactoring of: a) trace.h b) vioscsi.c - VioScsiHwInitialize() - corrects order of init for benefit of clean trace. 7. Major new instrumentation of: a) helper.c - InitVirtIODevice() 8. Reconfigured the following for INLINE function tracing: a) vioscsi.c - HandleResponse() b) vioscsi.c - PreProcessRequest() c) vioscsi.c - PostProcessRequest() d) vioscsi.c - DispatchQueue() 9. Mnemonic rename of VioScsiPassiveInitializeRoutine() to VioScsiPassiveDpcInitializeRoutine(). 10. Correct struct virtio_bar for bMemorySpace rather than bPortSpace (vioscsi.h and virtio_pci.c). 11. Add missing structs for PCI Capabilities (vioscsi.h). Hard to split this one up further methinks. I do have a fair bit of additional instrumentation to merge after this one. Signed-off-by: benyamin-codez <[email protected]>
Note somewhat cheeky inclusion to raise the kvm-guest-drivers-windows/vioscsi/vioscsi.vcxproj Lines 141 to 148 in 9b47ab2
|
Addendum to b6edb81, b7904fc and acaf26d. 1. Split NTDDI_ definitions to new file ntddi_ver.h with minor refactor. 2. Minor refactor for RegistryPath reporting to appear outside of conditional. 3. Removed references to obsoleted RUN_MIN_CHECKED definition (PR virtio-win#1228). Signed-off-by: benyamin-codez <[email protected]>
Addendum to 100af3e. 1. Removed references to obsoleted RUN_MIN_CHECKED definition (PR virtio-win#1228). 2. Add comment to conditionally excluded variable. Signed-off-by: benyamin-codez <[email protected]>
Addendum to c4ac94b. 1. Removed references to obsoleted RUN_MIN_CHECKED definition (PR virtio-win#1228). Signed-off-by: benyamin-codez <[email protected]>
Let me know if you need me to split that off and return to Does this need to be done by a different means anyway, e.g. via |
Introduced three (3) compile-time environment variables:
a)
RUN_WPP_ALL_PATHS
Compile WPP for the hot path too.
Is the inverse of
RUN_COLD_PATH_ONLY
, which is the default behaviour.b)
FORCE_RUN_UNCHECKED
Run without
EVENT_TRACING
orDBG
. DefinesRUN_UNCHECKED
.c)
FORCE_RUN_DEBUG
Run with
DBG
rather thanEVENT_TRACING
. UndefinesEVENT_TRACING
.WPP scans for WPP config on a per file basis. Sections of the config file cannot be excluded and conditional macros will be ignored. To solve this, we establish two new files with WPP configuration data. One holds exclusively cold path data (
wpp_cold_path.h
) and the other holds data for all paths (wpp_all_paths.h
). Which file to use is set conditionally per thevioscsi.vcxproj
project file configuration.The hot path DBG and WPP macro variants are a clone of the cold path macros, but with a "_HP" suffix. The exception to this is
RhelDbgPrint()
which we extend asRhelDbgPrintHotPath()
.Encapsulated exisitng cold and and hot trace messages in compile-time conditional macros and in same manner drops
*.tmh
includes when necessary. The general format for the cold path is#if !defined(RUN_UNCHECKED)
and for the hot path#if !defined(RUN_UNCHECKED) || !defined(RUN_COLD_PATH_ONLY)
.Minor refactoring of:
a)
helper.c
-GetScsiConfig()
b)
helper.c
-SetGuestFeatures()
Major refactoring of:
a)
trace.h
b)
vioscsi.c
-VioScsiHwInitialize()
- corrects order of init for benefit of clean trace.Major new instrumentation of:
a)
helper.c
-InitVirtIODevice()
Reconfigured the following for INLINE function tracing:
a)
vioscsi.c
-HandleResponse()
b)
vioscsi.c
-PreProcessRequest()
c)
vioscsi.c
-PostProcessRequest()
d)
vioscsi.c
-DispatchQueue()
Mnemonic rename of
VioScsiPassiveInitializeRoutine()
toVioScsiPassiveDpcInitializeRoutine()
.Correct struct
virtio_bar
forbMemorySpace
rather thanbPortSpace
(vioscsi.h
andvirtio_pci.c
).Add missing structs for PCI Capabilities (
vioscsi.h
).Included
stddef.h
foroffsetof
function.Hard to split this one up further methinks.
I do have a fair bit of additional instrumentation to merge after this one.