wip: test logging performance issues
Summary: Test Plan:
This commit is contained in:
@@ -30,7 +30,7 @@ void hdr_mutex_free(struct hdr_mutex* mutex)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <WinSock2.h>
|
#include <winsock2.h>
|
||||||
|
|
||||||
int hdr_mutex_init(struct hdr_mutex* mutex)
|
int hdr_mutex_init(struct hdr_mutex* mutex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -116,15 +116,17 @@ static int log_thread_proc(void *ctx)
|
|||||||
static void
|
static void
|
||||||
log_post(char level, const char *module, const char *fmt, va_list ap)
|
log_post(char level, const char *module, const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
if (WaitForSingleObject(log_rv_producer, INFINITE)) {
|
// TODO test if this addresses performance issues and stuttering
|
||||||
return;
|
// TODO measure time how long waiting takes here?
|
||||||
}
|
// if (WaitForSingleObject(log_rv_producer, INFINITE)) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
log_rv_level = level;
|
// log_rv_level = level;
|
||||||
log_rv_module = module;
|
// log_rv_module = module;
|
||||||
str_vformat(log_rv_buffer, sizeof(log_rv_buffer), fmt, ap);
|
// str_vformat(log_rv_buffer, sizeof(log_rv_buffer), fmt, ap);
|
||||||
|
|
||||||
ReleaseSemaphore(log_rv_consumer, 1, NULL);
|
// ReleaseSemaphore(log_rv_consumer, 1, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LOG_POST_IMPL(name, level) \
|
#define LOG_POST_IMPL(name, level) \
|
||||||
|
|||||||
@@ -261,7 +261,8 @@ skip:
|
|||||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||||
{
|
{
|
||||||
if (reason == DLL_PROCESS_ATTACH) {
|
if (reason == DLL_PROCESS_ATTACH) {
|
||||||
log_to_writer(log_writer_debug, NULL);
|
// TODO switched to null writer to see if it addresses performance issues
|
||||||
|
log_to_writer(log_writer_null, NULL);
|
||||||
|
|
||||||
/* Bootstrap hook for further init tasks (see above) */
|
/* Bootstrap hook for further init tasks (see above) */
|
||||||
|
|
||||||
|
|||||||
@@ -254,7 +254,8 @@ skip:
|
|||||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||||
{
|
{
|
||||||
if (reason == DLL_PROCESS_ATTACH) {
|
if (reason == DLL_PROCESS_ATTACH) {
|
||||||
log_to_writer(log_writer_debug, NULL);
|
// TODO switched to null writer to see if it addresses performance issues
|
||||||
|
log_to_writer(log_writer_null, NULL);
|
||||||
|
|
||||||
/* Bootstrap hook for further init tasks (see above) */
|
/* Bootstrap hook for further init tasks (see above) */
|
||||||
|
|
||||||
|
|||||||
@@ -246,7 +246,8 @@ skip:
|
|||||||
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||||
{
|
{
|
||||||
if (reason == DLL_PROCESS_ATTACH) {
|
if (reason == DLL_PROCESS_ATTACH) {
|
||||||
log_to_writer(log_writer_debug, NULL);
|
// TODO switched to null writer to see if it addresses performance issues
|
||||||
|
log_to_writer(log_writer_null, NULL);
|
||||||
|
|
||||||
/* Bootstrap hook for further init tasks (see above) */
|
/* Bootstrap hook for further init tasks (see above) */
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
dlls += iidxio-perf
|
dlls += iidxio-perf
|
||||||
|
|
||||||
ldflags_iidxio-perf := \
|
ldflags_iidxio-perf := \
|
||||||
|
-lws2_32
|
||||||
|
|
||||||
libs_iidxio-perf := \
|
libs_iidxio-perf := \
|
||||||
hdr-histogram \
|
hdr-histogram \
|
||||||
|
|||||||
Reference in New Issue
Block a user