Skip to content

Commit

Permalink
Updates for platform workers too
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks committed Oct 19, 2023
1 parent 0305e7d commit 8504b4d
Show file tree
Hide file tree
Showing 11 changed files with 285 additions and 93 deletions.
7 changes: 5 additions & 2 deletions scripts/run-gtest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ param (
[string]$OsRunner = "",

[Parameter(Mandatory = $false)]
[switch]$UseQtip = $false
[switch]$UseQtip = $false,

[Parameter(Mandatory = $false)]
[Int32]$Timeout = 60000
)

Set-StrictMode -Version 'Latest'
Expand Down Expand Up @@ -385,7 +388,7 @@ function Start-TestCase([String]$Name) {

# Build up the argument list.
$ResultsPath = Join-Path $LocalLogDir "results.xml"
$Arguments = "--gtest_catch_exceptions=0 --gtest_filter=$($Name) --gtest_output=xml:$($ResultsPath) --timeout 60000"
$Arguments = "--gtest_catch_exceptions=0 --gtest_filter=$($Name) --gtest_output=xml:$($ResultsPath) --timeout $Timeout"
if ($BreakOnFailure) {
$Arguments += " --gtest_break_on_failure"
}
Expand Down
7 changes: 5 additions & 2 deletions scripts/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ param (
[string]$OsRunner = "",

[Parameter(Mandatory = $false)]
[int]$NumIterations = 1
[int]$NumIterations = 1,

[Parameter(Mandatory = $false)]
[Int32]$Timeout = 60000
)

Set-StrictMode -Version 'Latest'
Expand Down Expand Up @@ -285,7 +288,7 @@ if (!(Test-Path $PfxFile)) {
}

# Build up all the arguments to pass to the Powershell script.
$TestArguments = "-IsolationMode $IsolationMode -PfxPath $PfxFile"
$TestArguments = "-IsolationMode $IsolationMode -PfxPath $PfxFile -Timeout $Timeout"

if ($DuoNic) {
$TestArguments += " -DuoNic"
Expand Down
7 changes: 6 additions & 1 deletion src/core/worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ QuicWorkerStartThread(
Worker
};

QuicTraceLogVerbose(
WorkerStarting,
"[wrkr][%p] Starting thread",
Worker);

QUIC_STATUS Status = CxPlatThreadCreate(&ThreadConfig, &Worker->Thread);
if (QUIC_FAILED(Status)) {
QuicTraceEvent(
Expand Down Expand Up @@ -137,7 +142,7 @@ QuicWorkerInitialize(
#else
if (ExecProfile != QUIC_EXECUTION_PROFILE_TYPE_MAX_THROUGHPUT) {
Worker->IsExternal = TRUE;
CxPlatAddExecutionContext(&Worker->ExecutionContext, PartitionIndex);
CxPlatAddExecutionContext(&Worker->ExecutionContext, PartitionIndex, FALSE);
} else {
//
// Don't start the thread until it's needed.
Expand Down
38 changes: 38 additions & 0 deletions src/generated/linux/platform_worker.c.clog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@
#ifdef __cplusplus
extern "C" {
#endif
/*----------------------------------------------------------
// Decoder Ring for PlatformWorkerThreadStarting
// [ lib][%p] Worker starting
// QuicTraceLogInfo(
PlatformWorkerThreadStarting,
"[ lib][%p] Worker starting",
Worker);
// arg2 = arg2 = Worker = arg2
----------------------------------------------------------*/
#ifndef _clog_3_ARGS_TRACE_PlatformWorkerThreadStarting
#define _clog_3_ARGS_TRACE_PlatformWorkerThreadStarting(uniqueId, encoded_arg_string, arg2)\
tracepoint(CLOG_PLATFORM_WORKER_C, PlatformWorkerThreadStarting , arg2);\

#endif




/*----------------------------------------------------------
// Decoder Ring for PlatformWorkerThreadStart
// [ lib][%p] Worker start
Expand Down Expand Up @@ -99,6 +117,26 @@ tracepoint(CLOG_PLATFORM_WORKER_C, LibraryError , arg2);\



/*----------------------------------------------------------
// Decoder Ring for LibraryErrorStatus
// [ lib] ERROR, %u, %s.
// QuicTraceEvent(
LibraryErrorStatus,
"[ lib] ERROR, %u, %s.",
Status,
"Create platform worker thread failed");
// arg2 = arg2 = Status = arg2
// arg3 = arg3 = "Create platform worker thread failed" = arg3
----------------------------------------------------------*/
#ifndef _clog_4_ARGS_TRACE_LibraryErrorStatus
#define _clog_4_ARGS_TRACE_LibraryErrorStatus(uniqueId, encoded_arg_string, arg2, arg3)\
tracepoint(CLOG_PLATFORM_WORKER_C, LibraryErrorStatus , arg2, arg3);\

#endif




#ifdef __cplusplus
}
#endif
Expand Down
42 changes: 42 additions & 0 deletions src/generated/linux/platform_worker.c.clog.h.lttng.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@



/*----------------------------------------------------------
// Decoder Ring for PlatformWorkerThreadStarting
// [ lib][%p] Worker starting
// QuicTraceLogInfo(
PlatformWorkerThreadStarting,
"[ lib][%p] Worker starting",
Worker);
// arg2 = arg2 = Worker = arg2
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_PLATFORM_WORKER_C, PlatformWorkerThreadStarting,
TP_ARGS(
const void *, arg2),
TP_FIELDS(
ctf_integer_hex(uint64_t, arg2, arg2)
)
)



/*----------------------------------------------------------
// Decoder Ring for PlatformWorkerThreadStart
// [ lib][%p] Worker start
Expand Down Expand Up @@ -78,3 +97,26 @@ TRACEPOINT_EVENT(CLOG_PLATFORM_WORKER_C, LibraryError,
ctf_string(arg2, arg2)
)
)



/*----------------------------------------------------------
// Decoder Ring for LibraryErrorStatus
// [ lib] ERROR, %u, %s.
// QuicTraceEvent(
LibraryErrorStatus,
"[ lib] ERROR, %u, %s.",
Status,
"Create platform worker thread failed");
// arg2 = arg2 = Status = arg2
// arg3 = arg3 = "Create platform worker thread failed" = arg3
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_PLATFORM_WORKER_C, LibraryErrorStatus,
TP_ARGS(
unsigned int, arg2,
const char *, arg3),
TP_FIELDS(
ctf_integer(unsigned int, arg2, arg2)
ctf_string(arg3, arg3)
)
)
66 changes: 44 additions & 22 deletions src/generated/linux/worker.c.clog.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#include "worker.c.clog.h.lttng.h"
#endif
#include <lttng/tracepoint-event.h>
#ifndef _clog_MACRO_QuicTraceLogVerbose
#define _clog_MACRO_QuicTraceLogVerbose 1
#define QuicTraceLogVerbose(a, ...) _clog_CAT(_clog_ARGN_SELECTOR(__VA_ARGS__), _clog_CAT(_,a(#a, __VA_ARGS__)))
#endif
#ifndef _clog_MACRO_QuicTraceLogConnVerbose
#define _clog_MACRO_QuicTraceLogConnVerbose 1
#define QuicTraceLogConnVerbose(a, ...) _clog_CAT(_clog_ARGN_SELECTOR(__VA_ARGS__), _clog_CAT(_,a(#a, __VA_ARGS__)))
Expand All @@ -25,6 +29,24 @@
#ifdef __cplusplus
extern "C" {
#endif
/*----------------------------------------------------------
// Decoder Ring for WorkerStarting
// [wrkr][%p] Starting thread
// QuicTraceLogVerbose(
WorkerStarting,
"[wrkr][%p] Starting thread",
Worker);
// arg2 = arg2 = Worker = arg2
----------------------------------------------------------*/
#ifndef _clog_3_ARGS_TRACE_WorkerStarting
#define _clog_3_ARGS_TRACE_WorkerStarting(uniqueId, encoded_arg_string, arg2)\
tracepoint(CLOG_WORKER_C, WorkerStarting , arg2);\

#endif




/*----------------------------------------------------------
// Decoder Ring for IndicateIdealProcChanged
// [conn][%p] Indicating QUIC_CONNECTION_EVENT_IDEAL_PROCESSOR_CHANGED (Proc=%hu,Indx=%hu)
Expand Down Expand Up @@ -65,6 +87,28 @@ tracepoint(CLOG_WORKER_C, AbandonOnLibShutdown , arg1);\



/*----------------------------------------------------------
// Decoder Ring for WorkerErrorStatus
// [wrkr][%p] ERROR, %u, %s.
// QuicTraceEvent(
WorkerErrorStatus,
"[wrkr][%p] ERROR, %u, %s.",
Worker,
Status,
"CxPlatThreadCreate");
// arg2 = arg2 = Worker = arg2
// arg3 = arg3 = Status = arg3
// arg4 = arg4 = "CxPlatThreadCreate" = arg4
----------------------------------------------------------*/
#ifndef _clog_5_ARGS_TRACE_WorkerErrorStatus
#define _clog_5_ARGS_TRACE_WorkerErrorStatus(uniqueId, encoded_arg_string, arg2, arg3, arg4)\
tracepoint(CLOG_WORKER_C, WorkerErrorStatus , arg2, arg3, arg4);\

#endif




/*----------------------------------------------------------
// Decoder Ring for WorkerCreated
// [wrkr][%p] Created, IdealProc=%hu Owner=%p
Expand All @@ -87,28 +131,6 @@ tracepoint(CLOG_WORKER_C, WorkerCreated , arg2, arg3, arg4);\



/*----------------------------------------------------------
// Decoder Ring for WorkerErrorStatus
// [wrkr][%p] ERROR, %u, %s.
// QuicTraceEvent(
WorkerErrorStatus,
"[wrkr][%p] ERROR, %u, %s.",
Worker,
Status,
"CxPlatThreadCreate");
// arg2 = arg2 = Worker = arg2
// arg3 = arg3 = Status = arg3
// arg4 = arg4 = "CxPlatThreadCreate" = arg4
----------------------------------------------------------*/
#ifndef _clog_5_ARGS_TRACE_WorkerErrorStatus
#define _clog_5_ARGS_TRACE_WorkerErrorStatus(uniqueId, encoded_arg_string, arg2, arg3, arg4)\
tracepoint(CLOG_WORKER_C, WorkerErrorStatus , arg2, arg3, arg4);\

#endif




/*----------------------------------------------------------
// Decoder Ring for WorkerCleanup
// [wrkr][%p] Cleaning up
Expand Down
73 changes: 46 additions & 27 deletions src/generated/linux/worker.c.clog.h.lttng.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@



/*----------------------------------------------------------
// Decoder Ring for WorkerStarting
// [wrkr][%p] Starting thread
// QuicTraceLogVerbose(
WorkerStarting,
"[wrkr][%p] Starting thread",
Worker);
// arg2 = arg2 = Worker = arg2
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_WORKER_C, WorkerStarting,
TP_ARGS(
const void *, arg2),
TP_FIELDS(
ctf_integer_hex(uint64_t, arg2, arg2)
)
)



/*----------------------------------------------------------
// Decoder Ring for IndicateIdealProcChanged
// [conn][%p] Indicating QUIC_CONNECTION_EVENT_IDEAL_PROCESSOR_CHANGED (Proc=%hu,Indx=%hu)
Expand Down Expand Up @@ -47,6 +66,33 @@ TRACEPOINT_EVENT(CLOG_WORKER_C, AbandonOnLibShutdown,



/*----------------------------------------------------------
// Decoder Ring for WorkerErrorStatus
// [wrkr][%p] ERROR, %u, %s.
// QuicTraceEvent(
WorkerErrorStatus,
"[wrkr][%p] ERROR, %u, %s.",
Worker,
Status,
"CxPlatThreadCreate");
// arg2 = arg2 = Worker = arg2
// arg3 = arg3 = Status = arg3
// arg4 = arg4 = "CxPlatThreadCreate" = arg4
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_WORKER_C, WorkerErrorStatus,
TP_ARGS(
const void *, arg2,
unsigned int, arg3,
const char *, arg4),
TP_FIELDS(
ctf_integer_hex(uint64_t, arg2, arg2)
ctf_integer(unsigned int, arg3, arg3)
ctf_string(arg4, arg4)
)
)



/*----------------------------------------------------------
// Decoder Ring for WorkerCreated
// [wrkr][%p] Created, IdealProc=%hu Owner=%p
Expand Down Expand Up @@ -74,33 +120,6 @@ TRACEPOINT_EVENT(CLOG_WORKER_C, WorkerCreated,



/*----------------------------------------------------------
// Decoder Ring for WorkerErrorStatus
// [wrkr][%p] ERROR, %u, %s.
// QuicTraceEvent(
WorkerErrorStatus,
"[wrkr][%p] ERROR, %u, %s.",
Worker,
Status,
"CxPlatThreadCreate");
// arg2 = arg2 = Worker = arg2
// arg3 = arg3 = Status = arg3
// arg4 = arg4 = "CxPlatThreadCreate" = arg4
----------------------------------------------------------*/
TRACEPOINT_EVENT(CLOG_WORKER_C, WorkerErrorStatus,
TP_ARGS(
const void *, arg2,
unsigned int, arg3,
const char *, arg4),
TP_FIELDS(
ctf_integer_hex(uint64_t, arg2, arg2)
ctf_integer(unsigned int, arg3, arg3)
ctf_string(arg4, arg4)
)
)



/*----------------------------------------------------------
// Decoder Ring for WorkerCleanup
// [wrkr][%p] Cleaning up
Expand Down
5 changes: 3 additions & 2 deletions src/inc/quic_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,14 @@ typedef struct CXPLAT_EXECUTION_CONTEXT {
} CXPLAT_EXECUTION_CONTEXT;

#ifdef _KERNEL_MODE // Not supported on kernel mode
#define CxPlatAddExecutionContext(Context, IdealProcessor) CXPLAT_FRE_ASSERT(FALSE)
#define CxPlatAddExecutionContext(Context, IdealProcessor, RunImmediately) CXPLAT_FRE_ASSERT(FALSE)
#define CxPlatWakeExecutionContext(Context) CXPLAT_FRE_ASSERT(FALSE)
#else
void
CxPlatAddExecutionContext(
_Inout_ CXPLAT_EXECUTION_CONTEXT* Context,
_In_ uint16_t Index // Into the execution config processor array
_In_ uint16_t Index, // Into the execution config processor array
_In_ BOOLEAN RunImmediately
);

void
Expand Down
Loading

0 comments on commit 8504b4d

Please sign in to comment.