<commit_before>#include <Windows.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>

#define INITGUID
#include <evntrace.h>

using namespace std;

int main() {
	EVENT_TRACE_PROPERTIES *eventTraceProp;
	TCHAR loggerName[] = KERNEL_LOGGER_NAME;
	TRACEHANDLE traceHandler = 0;
	size_t bufferSize = sizeof(EVENT_TRACE_PROPERTIES) + sizeof(loggerName);
	ULONG retCode;

	eventTraceProp = (EVENT_TRACE_PROPERTIES *) malloc(bufferSize);
	memset(eventTraceProp, 0, bufferSize);
	eventTraceProp->Wnode.BufferSize = bufferSize;
	eventTraceProp->Wnode.Guid = SystemTraceControlGuid;
	eventTraceProp->Wnode.ClientContext = 2;
	eventTraceProp->Wnode.Flags |= WNODE_FLAG_TRACED_GUID;
	eventTraceProp->LogFileMode = EVENT_TRACE_REAL_TIME_MODE;
	eventTraceProp->EnableFlags = EVENT_TRACE_FLAG_NETWORK_TCPIP;
	eventTraceProp->LogFileNameOffset = 0;	// don't log onto file
	eventTraceProp->LoggerNameOffset = sizeof(EVENT_TRACE_PROPERTIES);


	cout << traceHandler << endl;
	retCode = StartTrace(&traceHandler, loggerName, eventTraceProp);
	if (ERROR_SUCCESS != retCode) {
		if (ERROR_ALREADY_EXISTS == retCode) {
			cout << "Trace session already start!" << endl;
			cout << "Ready to stop it!" << endl;
			goto CLEANUP_ON_ERROR;
		}
		cout << "Start trace session failed: " << retCode << endl;
		goto CLEANUP_ON_ERROR;
	}
	cout << traceHandler << endl;


	return 0;

CLEANUP_ON_ERROR:
	retCode = ControlTrace(traceHandler, loggerName, eventTraceProp, EVENT_TRACE_CONTROL_STOP);
	if (ERROR_SUCCESS != retCode) {
		cout << "Stop trace session failed: " << retCode << endl;
		return -1;
	}
}<commit_msg>change output info of StartTraceSession<commit_after>#include <Windows.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>

#define INITGUID
#include <evntrace.h>

using namespace std;

int main() {
	EVENT_TRACE_PROPERTIES *eventTraceProp;
	TCHAR loggerName[] = KERNEL_LOGGER_NAME;
	TRACEHANDLE traceHandler = 0;
	size_t bufferSize = sizeof(EVENT_TRACE_PROPERTIES) + sizeof(loggerName);
	ULONG retCode;

	eventTraceProp = (EVENT_TRACE_PROPERTIES *) malloc(bufferSize);
	memset(eventTraceProp, 0, bufferSize);
	eventTraceProp->Wnode.BufferSize = bufferSize;
	eventTraceProp->Wnode.Guid = SystemTraceControlGuid;
	eventTraceProp->Wnode.ClientContext = 2;
	eventTraceProp->Wnode.Flags |= WNODE_FLAG_TRACED_GUID;
	eventTraceProp->LogFileMode = EVENT_TRACE_REAL_TIME_MODE;
	eventTraceProp->EnableFlags = EVENT_TRACE_FLAG_NETWORK_TCPIP;
	eventTraceProp->LogFileNameOffset = 0;	// don't log onto file
	eventTraceProp->LoggerNameOffset = sizeof(EVENT_TRACE_PROPERTIES);

	retCode = StartTrace(&traceHandler, loggerName, eventTraceProp);
	if (ERROR_SUCCESS != retCode) {
		if (ERROR_ALREADY_EXISTS == retCode) {
			cout << "Trace session already started! Ready to stop it!" << endl;
			goto cleanup;
		}
		cerr << "Start trace session failed: " << retCode << endl;
		goto cleanup;
	}

	cout << "Trace session started successfully!" << endl;

	return 0;

cleanup:
	retCode = ControlTrace(traceHandler, loggerName, eventTraceProp, EVENT_TRACE_CONTROL_STOP);
	if (ERROR_SUCCESS != retCode) {
		cerr << "Stopping trace session failed: " << retCode << endl;
		return -1;
	}
	cout << "Trace session stopped successfully!" << endl;
	return 0;
}
{'fraction_non_alphanumeric': 0.11148962527098173, 'fraction_numerical': 0.004026014245896562, 'mean_word_length': 5.931330472103005, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5185652', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1071, 'n_words': 242}