mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Allow setting memory limit in capture utility.
This commit is contained in:
parent
6748d11a2f
commit
ee56e1fcd5
@ -21,6 +21,7 @@
|
|||||||
#include "../../server/TracyFileWrite.hpp"
|
#include "../../server/TracyFileWrite.hpp"
|
||||||
#include "../../server/TracyMemory.hpp"
|
#include "../../server/TracyMemory.hpp"
|
||||||
#include "../../server/TracyPrint.hpp"
|
#include "../../server/TracyPrint.hpp"
|
||||||
|
#include "../../server/TracySysUtil.hpp"
|
||||||
#include "../../server/TracyWorker.hpp"
|
#include "../../server/TracyWorker.hpp"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -90,7 +91,7 @@ void AnsiPrintf( const char* ansiEscape, const char* format, ... ) {
|
|||||||
|
|
||||||
[[noreturn]] void Usage()
|
[[noreturn]] void Usage()
|
||||||
{
|
{
|
||||||
printf( "Usage: capture -o output.tracy [-a address] [-p port] [-f] [-s seconds]\n" );
|
printf( "Usage: capture -o output.tracy [-a address] [-p port] [-f] [-s seconds] [-m memlimit]\n" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +115,7 @@ int main( int argc, char** argv )
|
|||||||
int64_t memoryLimit = -1;
|
int64_t memoryLimit = -1;
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
while( ( c = getopt( argc, argv, "a:o:p:fs:" ) ) != -1 )
|
while( ( c = getopt( argc, argv, "a:o:p:fs:m:" ) ) != -1 )
|
||||||
{
|
{
|
||||||
switch( c )
|
switch( c )
|
||||||
{
|
{
|
||||||
@ -131,7 +132,10 @@ int main( int argc, char** argv )
|
|||||||
overwrite = true;
|
overwrite = true;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
seconds = atoi (optarg);
|
seconds = atoi(optarg);
|
||||||
|
break;
|
||||||
|
case 'm':
|
||||||
|
memoryLimit = std::clamp( atoll( optarg ), 1ll, 999ll ) * tracy::GetPhysicalMemorySize() / 100;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Usage();
|
Usage();
|
||||||
|
Loading…
Reference in New Issue
Block a user