Giter Club home page Giter Club logo

Comments (7)

jafingerhut avatar jafingerhut commented on July 17, 2024

Are you using the p4lang/tutorials Github repo code to run BMv2?

Are you running simple_switch_grpc command yourself, supplying all command line options?

Something else?

from p4-guide.

fengkeyleaf avatar fengkeyleaf commented on July 17, 2024

Are you using the p4lang/tutorials Github repo code to run BMv2?

Are you running simple_switch_grpc command yourself, supplying all command line options?

Something else?

Oh, sorry about not mentioning this.

I am using the tutorials Github repo code to run BMv2.

from p4-guide.

jafingerhut avatar jafingerhut commented on July 17, 2024

I do not know how to do this off the top of my head. The tutorials repository has a fair amount of Python code that is executed when you do make run in the tutorials/utils directory, which uses a Python library provided by the Mininet package for creating the simulated networks of multiple switches and hosts. I am not familiar enough with that Mininet Python library and what options it provides to know what should be changed to avoid logging to file, but this line of code looks like it is related: https://github.com/p4lang/tutorials/blob/master/utils/run_exercise.py#L94

I did a quick experiment by locally editing the tutorials/utils/run_exercise.py file as shown in the diff output below, and when I did make run the next time it did not create any log files with names like logs/s1.log:

diff --git a/utils/run_exercise.py b/utils/run_exercise.py
index 44c8ff6..780131d 100755
--- a/utils/run_exercise.py
+++ b/utils/run_exercise.py
@@ -91,7 +91,7 @@ class ExerciseTopo(Topo):
             else:
                 # add default switch
                 switchClass = None
-            self.addSwitch(sw, log_file="%s/%s.log" %(log_dir, sw), cls=switchClass)
+            self.addSwitch(sw, cls=switchClass)
 
         for link in host_links:
             host_name = link['node1']

from p4-guide.

fengkeyleaf avatar fengkeyleaf commented on July 17, 2024

I do not know how to do this off the top of my head. The tutorials repository has a fair amount of Python code that is executed when you do make run in the tutorials/utils directory, which uses a Python library provided by the Mininet package for creating the simulated networks of multiple switches and hosts. I am not familiar enough with that Mininet Python library and what options it provides to know what should be changed to avoid logging to file, but this line of code looks like it is related: https://github.com/p4lang/tutorials/blob/master/utils/run_exercise.py#L94

I did a quick experiment by locally editing the tutorials/utils/run_exercise.py file as shown in the diff output below, and when I did make run the next time it did not create any log files with names like logs/s1.log:

diff --git a/utils/run_exercise.py b/utils/run_exercise.py
index 44c8ff6..780131d 100755
--- a/utils/run_exercise.py
+++ b/utils/run_exercise.py
@@ -91,7 +91,7 @@ class ExerciseTopo(Topo):
             else:
                 # add default switch
                 switchClass = None
-            self.addSwitch(sw, log_file="%s/%s.log" %(log_dir, sw), cls=switchClass)
+            self.addSwitch(sw, cls=switchClass)
 
         for link in host_links:
             host_name = link['node1']

Thanks , I will give a try to see if it works or not.

from p4-guide.

fengkeyleaf avatar fengkeyleaf commented on July 17, 2024

I do not know how to do this off the top of my head. The tutorials repository has a fair amount of Python code that is executed when you do make run in the tutorials/utils directory, which uses a Python library provided by the Mininet package for creating the simulated networks of multiple switches and hosts. I am not familiar enough with that Mininet Python library and what options it provides to know what should be changed to avoid logging to file, but this line of code looks like it is related: https://github.com/p4lang/tutorials/blob/master/utils/run_exercise.py#L94

I did a quick experiment by locally editing the tutorials/utils/run_exercise.py file as shown in the diff output below, and when I did make run the next time it did not create any log files with names like logs/s1.log:

diff --git a/utils/run_exercise.py b/utils/run_exercise.py
index 44c8ff6..780131d 100755
--- a/utils/run_exercise.py
+++ b/utils/run_exercise.py
@@ -91,7 +91,7 @@ class ExerciseTopo(Topo):
             else:
                 # add default switch
                 switchClass = None
-            self.addSwitch(sw, log_file="%s/%s.log" %(log_dir, sw), cls=switchClass)
+            self.addSwitch(sw, cls=switchClass)
 
         for link in host_links:
             host_name = link['node1']

It seems that the switch outputs the logging into another file named p4s.s1.log, which is located in /tmp. I think it's very difficult to turn the logging off at this point.

from p4-guide.

jafingerhut avatar jafingerhut commented on July 17, 2024

If you avoid using mininet, and run simple_switch_grpc directly, you have complete control of the logging on or off, and whether it goes (a) nowhere, (b) to a file, or (c) to the console.

I am less familiar with mininet and all of its options and how to control them. You should consider asking people more familiar with mininet, and/or try asking your question on https://forum.p4.org, to see if someone there knows how to do what you wish.

from p4-guide.

fengkeyleaf avatar fengkeyleaf commented on July 17, 2024

If you avoid using mininet, and run simple_switch_grpc directly, you have complete control of the logging on or off, and whether it goes (a) nowhere, (b) to a file, or (c) to the console.

I am less familiar with mininet and all of its options and how to control them. You should consider asking people more familiar with mininet, and/or try asking your question on https://forum.p4.org, to see if someone there knows how to do what you wish.

Thanks for your suggestions.

from p4-guide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.