jafingerhut / p4-guide

Guide to p4lang repositories and some other public info about P4
530 stars 155 forks source link

Issue in log file for bmv2 switch #33

Closed drobinkent closed 4 years ago

drobinkent commented 4 years ago

I am trying to run a bmv2 based sitch using simple_switch_grpc. The command for starting the switch is

simple_switch_grpc --device-id 1 -i 1@p0l0-eth1 -i 2@p0l0-eth2 -i 3@p0l0-eth3 -i 4@p0l0-eth4 -i 5@p0l0-eth5 -i 6@p0l0-eth6 -i 7@p0l0-eth7 -i 8@p0l0-eth8 --thrift-port 52765 --nanolog ipc:///tmp/bmv2-p0l0-nanolog.ipc --debugger-addr ipc:///tmp/bmv2-p0l0-debug.ipc -Lwarn --no-p4 -- --cpu-port 255 --grpc-server-addr 127.0.0.1:60000 --log-file p0l0.log

But I am getting the error message :

unrecognised option '--log-file'

I have compiled the simple_switch_grps with --enable-debugger option. But still it's not working for the log file. Can anyone please help me?

jafingerhut commented 4 years ago

If I run simple_switch_grpc --help on my system, I see many command line options documented, followed by these lines:

This target also comes with its own command line parser, make sure you separate general bmv2 options from, target specific options with '--'

Those lines are followed by these:

Target specific options:
Target options:
  --load-modules arg        Load the given .so files (comma-separated) as 
                            modules.
  --disable-swap            disable JSON swapping at runtime
  --grpc-server-addr arg    bind gRPC server to given address [default is 
                            0.0.0.0:50051]
  --cpu-port arg            set CPU port, will be used for packet-in / 
                            packet-out; do not add an interface with this port 
                            number
  --drop-port arg           choose drop port number (default is 511)
  --dp-grpc-server-addr arg use a gRPC channel to inject and receive dataplane 
                            packets; bind this gRPC server to given address, 
                            e.g. 0.0.0.0:50052

Those target-specific options, if they appear at all, must appear after -- on the command line. All others must appear before the --.

drobinkent commented 4 years ago

I have used double hyphen '

--log-file'

Seems I am missing something. Can you kindly tell me what should be the option if I want to push the logs in file?

drobinkent commented 4 years ago

I got it. It should be


I was misinterpreting this. Thanks a lot for the help.