Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| vimage:notes200808devsummit [2008/08/23 15:45] – Add howto identify file static globals with collliding names; Submitted by: kris (magic changed by me) BjoernZeeb | vimage:notes200808devsummit [2014/10/12 22:42] (current) – renamed from Image/Notes200808DevSummit CraigRodrigues | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| * We are going to reflect on this at the upcoming EuroBSDCon2008 [[/ | * We are going to reflect on this at the upcoming EuroBSDCon2008 [[/ | ||
| + | *REALITY* Step 2 was committed DECEMBER 10 | ||
| ==== The 4.5 steps ==== | ==== The 4.5 steps ==== | ||
| Line 22: | Line 23: | ||
| * Invalidates most of the patches out there. | * Invalidates most of the patches out there. | ||
| - | 1.5. Further style changes (NOP) bringing in more infrastructure: | + | 1.5. [DONE] |
| - [DONE] Resolve file local statics with conflicting names. | - [DONE] Resolve file local statics with conflicting names. | ||
| - | - Import INIT_VNET_* as NOPs along with net/vnet.h, netinet/ | + | - [DONE] |
| - | - Import " | + | - [DONE]Import " |
| - | 2. Move the globals into a struct (g.v): | + | 2.[DONE] |
| * Make sure the macros from step 1.5 are no longer NOPs. | * Make sure the macros from step 1.5 are no longer NOPs. | ||
| * Bring in per module constructor functions. | * Bring in per module constructor functions. | ||
| Line 47: | Line 48: | ||
| * In kernel structure will be called whatever they will be called. He who implements decides. | * In kernel structure will be called whatever they will be called. He who implements decides. | ||
| * We want an explicit opt-in for any recursive changes. | * We want an explicit opt-in for any recursive changes. | ||
| + | |||
| + | ===== Progress report | ||
| + | |||
| + | I (julian) have been testing going backwards and forwards using the VIMAGE_GLOBALS option and have see no significant performance changes between the original code and the same code compiled with a set of global structures. Looking at the generated code I can see that the compiler is resolving the locations of each field in the structures and the resulting instructions are almost identical with only the addesses being differnet. | ||
| ===== HOWTO identify file static global variables with colliding names ===== | ===== HOWTO identify file static global variables with colliding names ===== | ||
| - | You can use nm(1) to do this on you kernel/ | + | You can use nm(1) on your kernel/ |
| - | '' | + | |
| - | ===== HOWTO verify that the pure style changes are all right ===== | + | < |
| + | nm *.o | awk '/ [bd] / { print $3 }' | sort | uniq -c | awk '{ if ($1 > 1) { print $0 } }' | ||
| + | </ | ||
| + | |||
| + | ===== HOWTO verify that the pure style changes are all right, aka. The MD5 Dance ===== | ||
| + | |||
| + | - Turn off INVARIANTS/ | ||
| + | |||
| + | < | ||
| + | cd / | ||
| + | make LINT | ||
| + | </ | ||
| + | |||
| + | Generate a VIMAGE_LINT (or an equivalent for GENERIC): | ||
| + | |||
| + | < | ||
| + | include | ||
| + | ident | ||
| + | nooptions | ||
| + | nooptions | ||
| + | </ | ||
| + | |||
| + | - Bump '' | ||
| + | - '' | ||
| + | |||
| + | < | ||
| + | --- sys/ | ||
| + | +++ sys/ | ||
| + | @@ -132,4 +132,4 @@ struct lock_class { | ||
| + | #if LOCK_DEBUG > 0 | ||
| + | # | ||
| + | -# | ||
| + | +# | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | - Build kernel once with the whitespace and once with the real patch. | ||
| + | |||
| + | < | ||
| + | config VIMAGE_LINT | ||
| + | cd ../ | ||
| + | make -s cleandepend __MAKE_CONF=/ | ||
| + | make -s depend __MAKE_CONF=/ | ||
| + | make -s __MAKE_CONF=/ | ||
| + | </ | ||
| + | |||
| + | or run following from src/ | ||
| + | |||
| + | < | ||
| + | make buildkernel KERNCONF=VIMAGE_LINT __MAKE_CONF=/ | ||
| + | </ | ||
| + | |||
| + | - Strip the *.o files in sys/ | ||
| + | |||
| + | < | ||
| + | find . -type f -name " | ||
| + | </ | ||
| + | |||
| + | - Run md5 on each .o file and save the output depending on the tree. | ||
| + | |||
| + | < | ||
| + | find . -type f -name " | ||
| + | </ | ||
| - | - Turn off INVARIANTS/ | ||
| - | - Bump '' | ||
| - | - '' | ||
| - | - Build kernel once with the whitespace and once with the real patch. Strip the *.o files and run md5 on each file in obj/ | ||
| - Comparing the md5 output of both runs, checksums of *.o should only differ in vers.o, which records the timestamp of the kernel build. | - Comparing the md5 output of both runs, checksums of *.o should only differ in vers.o, which records the timestamp of the kernel build. | ||
| + | |||
| + | < | ||
| + | diff -u / | ||
| + | </ | ||
| ===== Unvirtualized (or not finished) parts of the network stack ===== | ===== Unvirtualized (or not finished) parts of the network stack ===== | ||