@@ -70,7 +70,7 @@ uint32_t gCfgSystemPorts = 0;
70
70
71
71
void usage ()
72
72
{
73
- cout << " usage: orchagent [-h] [-r record_type] [-d record_location] [-b batch_size] [-m MAC] [-i INST_ID] [-s] [-z mode]" << endl;
73
+ cout << " usage: orchagent [-h] [-r record_type] [-d record_location] [-f swss_rec_filename] [-j sairedis_rec_filename] [- b batch_size] [-m MAC] [-i INST_ID] [-s] [-z mode]" << endl;
74
74
cout << " -h: display this message" << endl;
75
75
cout << " -r record_type: record orchagent logs with type (default 3)" << endl;
76
76
cout << " 0: do not record logs" << endl;
@@ -83,6 +83,8 @@ void usage()
83
83
cout << " -i INST_ID: set the ASIC instance_id in multi-asic platform" << endl;
84
84
cout << " -s: enable synchronous mode (depreacated, use -z)" << endl;
85
85
cout << " -z: redis communication mode (redis_async|redis_sync|zmq_sync), default: redis_async" << endl;
86
+ cout << " -f swss_rec_filename: swss record log filename(default 'swss.rec')" << endl;
87
+ cout << " -j sairedis_rec_filename: sairedis record log filename(default sairedis.rec)" << endl;
86
88
}
87
89
88
90
void sighup_handler (int signo)
@@ -284,8 +286,10 @@ int main(int argc, char **argv)
284
286
sai_status_t status;
285
287
286
288
string record_location = " ." ;
289
+ string swss_rec_filename = " swss.rec" ;
290
+ string sairedis_rec_filename = " sairedis.rec" ;
287
291
288
- while ((opt = getopt (argc, argv, " b:m:r:d:i:hsz:" )) != -1 )
292
+ while ((opt = getopt (argc, argv, " b:m:r:f:j: d:i:hsz:" )) != -1 )
289
293
{
290
294
switch (opt)
291
295
{
@@ -350,7 +354,19 @@ int main(int argc, char **argv)
350
354
case ' z' :
351
355
sai_deserialize_redis_communication_mode (optarg , gRedisCommunicationMode );
352
356
break ;
357
+ case ' f' :
353
358
359
+ if (optarg )
360
+ {
361
+ swss_rec_filename = optarg ;
362
+ }
363
+ break ;
364
+ case ' j' :
365
+ if (optarg )
366
+ {
367
+ sairedis_rec_filename = optarg ;
368
+ }
369
+ break ;
354
370
default : /* '?' */
355
371
exit (EXIT_FAILURE);
356
372
}
@@ -359,7 +375,7 @@ int main(int argc, char **argv)
359
375
SWSS_LOG_NOTICE (" --- Starting Orchestration Agent ---" );
360
376
361
377
initSaiApi ();
362
- initSaiRedis (record_location);
378
+ initSaiRedis (record_location, sairedis_rec_filename );
363
379
364
380
sai_attribute_t attr;
365
381
vector<sai_attribute_t > attrs;
@@ -374,7 +390,7 @@ int main(int argc, char **argv)
374
390
/* Disable/enable SwSS recording */
375
391
if (gSwssRecord )
376
392
{
377
- gRecordFile = record_location + " /" + " swss.rec " ;
393
+ gRecordFile = record_location + " /" + swss_rec_filename ;
378
394
gRecordOfs .open (gRecordFile , std::ofstream::out | std::ofstream::app);
379
395
if (!gRecordOfs .is_open ())
380
396
{
0 commit comments