-
Notifications
You must be signed in to change notification settings - Fork 387
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
Open
benyamin-codez
wants to merge
1
commit into
virtio-win:master
Choose a base branch
from
benyamin-codez:vioscsi-trace-two-path
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[vioscsi] Implement cold and hot tracing paths #1228
benyamin-codez
wants to merge
1
commit into
virtio-win:master
from
benyamin-codez:vioscsi-trace-two-path
+1,536
−407
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]>
benyamin-codez
requested review from
vrozenfe and
YanVugenfirer
as code owners
December 20, 2024 10:23
Note somewhat cheeky inclusion to raise the kvm-guest-drivers-windows/vioscsi/vioscsi.vcxproj Lines 141 to 148 in 9b47ab2
|
This was referenced Dec 21, 2024
benyamin-codez
added a commit
to benyamin-codez/kvm-guest-drivers-windows
that referenced
this pull request
Dec 21, 2024
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]>
benyamin-codez
added a commit
to benyamin-codez/kvm-guest-drivers-windows
that referenced
this pull request
Dec 21, 2024
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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.