Skip to content

Commit fd55488

Browse files
Add the new marking log to tools as well
1 parent ad4c15f commit fd55488

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

scripts/lava.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ def out(lst, str=''):
379379
out(targets_read_headers, 'void tensor_update(lava_file_reader& reader, uint32_t device_index, uint32_t tensor_index, uint64_t size, const VkBaseOutStructure* sptr);')
380380
out(targets_read_headers, 'void terminate_all(lava_file_reader& reader, VkDevice device);')
381381
out(targets_read_headers, 'void reset_for_tools();')
382+
out(targets_read_headers, 'trackable& object_trackable(VkObjectType type, uint64_t handle);')
382383
out(targets_read_headers)
383384

384385
out(targets_read, 'void retrace_init(lava_reader& replayer, const Json::Value& v, int heap_size, bool run)')

src/hardcode_read.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static uint64_t object_lookup(VkObjectType type, uint32_t index)
201201
return 0;
202202
}
203203

204-
static trackable& object_trackable(VkObjectType type, uint64_t handle)
204+
trackable& object_trackable(VkObjectType type, uint64_t handle)
205205
{
206206
static trackable dummy;
207207
switch (type)

src/tool.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,21 @@ static void replay_thread(lava_reader* replayer, int thread_id)
9595
}
9696
}
9797

98+
static void callback_vkSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes,
99+
const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData)
100+
{
101+
if (!pCallbackData) return;
102+
if (pCallbackData->pObjects && pCallbackData->objectCount > 0 && pCallbackData->pMessage)
103+
{
104+
trackable& t = object_trackable(pCallbackData->pObjects[0].objectType, pCallbackData->pObjects[0].objectHandle);
105+
DLOG("Marker for %s[%d]: " MAKEBLUE("%s"), pretty_print_VkObjectType(pCallbackData->pObjects[0].objectType), (int)t.index, pCallbackData->pMessage);
106+
}
107+
else if (pCallbackData->pMessage)
108+
{
109+
DLOG("Marker: " MAKEBLUE("%s"), pCallbackData->pMessage);
110+
}
111+
}
112+
98113
static void callback_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule)
99114
{
100115
static int count = 0;
@@ -248,6 +263,7 @@ int main(int argc, char **argv)
248263
// Add callbacks
249264
vkCreateShaderModule_callbacks.push_back(callback_vkCreateShaderModule);
250265
vkDestroyDevice_callbacks.push_back(callback_vkDestroyDevice);
266+
vkSubmitDebugUtilsMessageEXT_callbacks.push_back(callback_vkSubmitDebugUtilsMessageEXT);
251267

252268
for (unsigned i = 0; i < replayer.threads.size(); i++)
253269
{

0 commit comments

Comments
 (0)