src/vs/base/parts/ipc/common/ipc.net.ts/traceSocketEvent
	export function traceSocketEvent(nativeObject: any, socketDebugLabel: string, type: SocketDiagnosticsEventType, data?: VSBuffer | Uint8Array | ArrayBuffer | ArrayBufferView | any): void {
		if (!enableDiagnostics) {
			return;
		}
		const id = getSocketId(nativeObject, socketDebugLabel);

		if (data instanceof VSBuffer || data instanceof Uint8Array || data instanceof ArrayBuffer || ArrayBuffer.isView(data)) {
			const copiedData = VSBuffer.alloc(data.byteLength);
			copiedData.set(data);
			records.push({ timestamp: Date.now(), id, label: socketDebugLabel, type, buff: copiedData });
		} else {
			// data is a custom object
			records.push({ timestamp: Date.now(), id, label: socketDebugLabel, type, data: data });
		}
	}