Instrumentor
- 'Instrumentor' now creates a directory for the specified session path - Added <filesystem> to <ltpch>
This commit is contained in:
		
							parent
							
								
									dff6bec35c
								
							
						
					
					
						commit
						590c319d4d
					
				
					 3 changed files with 14 additions and 9 deletions
				
			
		| 
						 | 
					@ -20,6 +20,8 @@ namespace Light {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void Instrumentor::BeginSessionImpl(const std::string& outputPath)
 | 
						void Instrumentor::BeginSessionImpl(const std::string& outputPath)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
							std::filesystem::create_directory(outputPath.substr(0, outputPath.find_last_of('/') + 1));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		m_OutputFileStream.open(outputPath);
 | 
							m_OutputFileStream.open(outputPath);
 | 
				
			||||||
		m_OutputFileStream << "{\"traceEvents\":[";
 | 
							m_OutputFileStream << "{\"traceEvents\":[";
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,7 +17,7 @@ namespace Light {
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// #todo: add event categories
 | 
						// #todo: add event categories
 | 
				
			||||||
	// #todo: use ofstream in a seperate thread
 | 
						// #todo: use ofstream in a separate thread
 | 
				
			||||||
	class Instrumentor
 | 
						class Instrumentor
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
	private:
 | 
						private:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,9 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ENGINE //
 | 
					//** ENGINE **//
 | 
				
			||||||
#include "Base.h"
 | 
					#include "Base.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// PLATFORM SPECIFIC //
 | 
					//** PLATFORM SPECIFIC **//
 | 
				
			||||||
// windows
 | 
					// windows
 | 
				
			||||||
#ifdef _WIN32
 | 
					#ifdef _WIN32
 | 
				
			||||||
	#define NOMINMAX
 | 
						#define NOMINMAX
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,7 @@
 | 
				
			||||||
	#undef NOMINMAX
 | 
						#undef NOMINMAX
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// CONTAINERS //
 | 
					//** CONTAINERS **//
 | 
				
			||||||
#include <array>
 | 
					#include <array>
 | 
				
			||||||
#include <vector>
 | 
					#include <vector>
 | 
				
			||||||
#include <list>
 | 
					#include <list>
 | 
				
			||||||
| 
						 | 
					@ -21,26 +21,29 @@
 | 
				
			||||||
#include <unordered_map>
 | 
					#include <unordered_map>
 | 
				
			||||||
#include <unordered_set>
 | 
					#include <unordered_set>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// MISCELLANEOUS //
 | 
					//** MISCELLANEOUS **//
 | 
				
			||||||
#include <algorithm>
 | 
					#include <algorithm>
 | 
				
			||||||
#include <functional>
 | 
					#include <functional>
 | 
				
			||||||
#include <memory>
 | 
					#include <memory>
 | 
				
			||||||
#include <tuple>
 | 
					#include <tuple>
 | 
				
			||||||
#include <utility>
 | 
					#include <utility>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// INPUT_OUTPUT //
 | 
					//** INPUT_OUTPUT **//
 | 
				
			||||||
#include <iostream>
 | 
					#include <iostream>
 | 
				
			||||||
#include <fstream>
 | 
					#include <fstream>
 | 
				
			||||||
#include <sstream>
 | 
					#include <sstream>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// MULTI_THREADING //
 | 
					//** MULTI_THREADING **//
 | 
				
			||||||
#include <thread>
 | 
					#include <thread>
 | 
				
			||||||
#include <atomic>
 | 
					#include <atomic>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// STRING //
 | 
					//** STRING **//
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
#include <string_view>
 | 
					#include <string_view>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// C_LIBRARIES //
 | 
					//** FILESYSTEM  **//
 | 
				
			||||||
 | 
					#include <filesystem>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//** C_LIBRARIES **//
 | 
				
			||||||
#include <time.h>
 | 
					#include <time.h>
 | 
				
			||||||
#include <math.h>
 | 
					#include <math.h>
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue