Permalink
Browse files

fset operations optimised

  • Loading branch information...
tpoder1 committed Dec 22, 2014
1 parent 3cd9aa6 commit ec1b0db04b17409b85dc618ef8956411c033ebc3
Showing with 721 additions and 489 deletions.
  1. +13 −8 check_items_map.pl
  2. +1 −1 prepare-nfdump.sh
  3. +694 −68 src/fields.c
  4. +9 −4 src/fields.h
  5. +4 −408 src/libnf.c
View
@@ -28,7 +28,7 @@
my $MASTER_RECORD_FILE = "nfdump/bin/nffile.h";
# path to libnf C and H source files
-my $LIBNF_C_FILE = "src/libnf.c";
+my $LIBNF_C_FILE = "src/fields.c";
# The perl structure parsed from
@@ -138,17 +138,22 @@ ()
# /* TAG for check_items_map.pl: function_name */
# and ^}$ .
- if (/TAG for check_items_map.pl: (\w+)/) {
+ #if (/TAG for check_items_map.pl: (\w+)/) {
+ if (/static int inline lnf_field_(f[gs]et)_/) {
$funcname = $1;
- $LIBNF_C_FUNC{$funcname} = "";
+# $LIBNF_C_FUNC{$funcname} = "";
next;
}
if (/^}$/) {
$funcname = undef;
}
if (defined($funcname)) {
- $LIBNF_C_FUNC{$funcname} .= $_;
+ if (defined($LIBNF_C_FUNC{$funcname})) {
+ $LIBNF_C_FUNC{$funcname} .= $_;
+ } else {
+ $LIBNF_C_FUNC{$funcname} = $_;
+ }
}
}
}
@@ -188,8 +193,8 @@ ($$)
next if ($_->{'description'} =~ /^$/);
next if ($_->{'description'} =~ /Compat NEL/);
- my $read = str_count($LIBNF_C_FUNC{'lnf_rec_fget'}, $_->{'id'});
- my $write = str_count($LIBNF_C_FUNC{'lnf_rec_fset'}, $_->{'id'});
+ my $read = str_count($LIBNF_C_FUNC{'fget'}, $_->{'id'});
+ my $write = str_count($LIBNF_C_FUNC{'fset'}, $_->{'id'});
next if ($read > 0 && $write > 0);
@@ -214,8 +219,8 @@ ($$)
next if ($_->{'name'} =~ /exporter_sysid/);
next if ($_->{'name'} =~ /nat_flags/);
- my $read = str_count($LIBNF_C_FUNC{'lnf_rec_fget'}, $_->{'name'});
- my $write = str_count($LIBNF_C_FUNC{'lnf_rec_fset'}, $_->{'name'});
+ my $read = str_count($LIBNF_C_FUNC{'fget'}, $_->{'name'});
+ my $write = str_count($LIBNF_C_FUNC{'fset'}, $_->{'name'});
next if ($read > 0 && $write > 0);
View
@@ -91,7 +91,7 @@ echo "##########################################################"
echo "# STAGE 3: checking definitions of all items in libnf #"
echo "##########################################################"
echo ""
-##./check_items_map.pl || exit 1
+./check_items_map.pl || exit 1
echo ""
echo "##########################################################"
Oops, something went wrong.

0 comments on commit ec1b0db

Please sign in to comment.