Changes

1,120 bytes added ,  18:34, 23 January 2019
Line 25: Line 25:  
=== Optimize logging engine ===
 
=== Optimize logging engine ===
 
   
 
   
'''Summary:''' TODO: Short description of the project
+
'''Summary:''' CRIU puts a lots of logs when doing its job. Logging is done with simple fprintf function. They are typically useless, but ''if'' some operation fails -- the logs are the only way to find what was the reason for failure.
+
 
TODO: Detailed description of the project.
+
At the same time the printf family of functions is known to take some time to work -- they need to scan the format string for %-s and then convert the arguments into strings. If comparing criu dump with and without logs the time difference is notable (15%-20%), so speeding the logs up will help improve criu performance.
 +
 
 +
One of the solutions to the problem might be binary logging. The problem with binary logs is the amount of efforts to convert existing logs to binary form. Preferably, the switch to binary logging either keeps existing log() calls intact, either has some automatics to convert them.
 +
 
 +
The option to keep log() calls intact might be in pre-compilation pass of the sources. In this pass each <code>log(fmt, ...)</code> call gets translated into a call to a binary log function that saves <code>fmt</code> identifier copies all the args ''as is'' into the log file. The binary log decode utility, required in this case, should then find the fmt string by its ID in the log file and print the resulting message.
 +
 
 
   
 
   
 
'''Links:'''
 
'''Links:'''
* Wiki links to relevant material
+
* [[Better logging]]
* External links to mailing lists or web sites
   
   
 
   
 
'''Details:'''
 
'''Details:'''
* Skill level: beginner or intermediate or advanced
+
* Skill level: intermediate
 
* Language: C
 
* Language: C
* Mentor: Andrei Vagin <avagin@gmail.com>
+
* Mentor: Andrei Vagin <avagin@gmail.com>, Pavel Emelyanov <xemul@openvz.org>
 
* Suggested by: Andrei Vagin <avagin@gmail.com>
 
* Suggested by: Andrei Vagin <avagin@gmail.com>
      
=== Add support for checkpoint/restore of cgroups v2 ===
 
=== Add support for checkpoint/restore of cgroups v2 ===