[apparmor] [PATCH 11/20] Rename trans-XXXX transition to compress- compression

John Johansen john.johansen at canonical.com
Fri Nov 5 05:51:07 GMT 2010


trans- isn't a very good name for this phase of compilation.  It is the
compression phase, rename to trans- to compress- to reflect this.

Signed-off-by: John Johansen <john.johansen at canonical.com>
---
 parser/libapparmor_re/regexp.y |    8 ++++----
 parser/parser_main.c           |   20 ++++++++++----------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/parser/libapparmor_re/regexp.y b/parser/libapparmor_re/regexp.y
index 0c4debd..3494ecc 100644
--- a/parser/libapparmor_re/regexp.y
+++ b/parser/libapparmor_re/regexp.y
@@ -2178,7 +2178,7 @@ TransitionTable::TransitionTable(DFA& dfa, map<uchar, uchar>& eq,
 {
 
 	if (flags & DFA_DUMP_TRANS_PROGRESS)
-		fprintf(stderr, "Creating trans table:\r");
+		fprintf(stderr, "Compressing trans table:\r");
 
 
 	if (eq.empty())
@@ -2247,7 +2247,7 @@ TransitionTable::TransitionTable(DFA& dfa, map<uchar, uchar>& eq,
 			if (flags & (DFA_DUMP_TRANS_PROGRESS)) {
 				count++;
 				if (count % 100 == 0)
-					fprintf(stderr, "\033[2KCreating trans table: insert state: %d/%ld\r", count, dfa.states.size());
+					fprintf(stderr, "\033[2KCompressing trans table: insert state: %d/%ld\r", count, dfa.states.size());
 			}
 		}
 	} else {
@@ -2262,14 +2262,14 @@ TransitionTable::TransitionTable(DFA& dfa, map<uchar, uchar>& eq,
 			if (flags & (DFA_DUMP_TRANS_PROGRESS)) {
 				count++;
 				if (count % 100 == 0)
-					fprintf(stderr, "\033[2KCreating trans table: insert state: %d/%ld\r", count, dfa.states.size());
+					fprintf(stderr, "\033[2KCompressing trans table: insert state: %d/%ld\r", count, dfa.states.size());
 			}
 		}
 	}
 
 	if (flags & (DFA_DUMP_TRANS_STATS | DFA_DUMP_TRANS_PROGRESS)) {
 		ssize_t size = 4 * next_check.size() + 6 * dfa.states.size();
-		fprintf(stderr, "\033[2KCreated trans table: states %ld, next/check %ld, optimal next/check %ld avg/state %.2f, compression %ld/%ld = %.2f %%\n", dfa.states.size(), next_check.size(), optimal, (float)next_check.size()/(float)dfa.states.size(), size, 512 * dfa.states.size(), 100.0 - ((float) size * 100.0 / (float)(512 * dfa.states.size())));
+		fprintf(stderr, "\033[2KCompressed trans table: states %ld, next/check %ld, optimal next/check %ld avg/state %.2f, compression %ld/%ld = %.2f %%\n", dfa.states.size(), next_check.size(), optimal, (float)next_check.size()/(float)dfa.states.size(), size, 512 * dfa.states.size(), 100.0 - ((float) size * 100.0 / (float)(512 * dfa.states.size())));
 	}
 }
 
diff --git a/parser/parser_main.c b/parser/parser_main.c
index 140e226..0e92678 100644
--- a/parser/parser_main.c
+++ b/parser/parser_main.c
@@ -198,9 +198,9 @@ static void display_dump(char *command)
 	       "dfa-graph		Dump dfa dot (graphviz) graph\n"
 	       "dfa-minimize		Dump dfa minimization\n"
 	       "dfa-unreachable		Dump dfa unreachable states\n"
-	       "trans-progress		Dump progress of transition table\n"
-	       "trans-stats		Dump stats on transition table\n"
-	       "trans-table		Dump transition table\n"
+	       "compress-progress	Dump progress of compression\n"
+	       "compress-stats		Dump stats on compression\n"
+	       "compressed-dfa		Dump compressed dfa\n"
 	       "equiv-stats		Dump equivance class stats\n"
 	       "equiv			Dump equivance class\n"
 	       ,command);
@@ -222,8 +222,8 @@ static void display_optimize(char *command)
 	       "[no-]hash-perms		use permission hashing to setup partitions at start of minimization\n"
 	       "[no-]hash-trans		use transition hashing to setup partitions at start of minimization\n"
 	       "[no-]remove-unreachable	do unreachable state removal\n"
-	       "trans-comp-high		try to do extra transition table compression\n"
-	       "trans-comp-fast		do faster transition table compression\n"
+	       "compress-high		try to do extra transition table compression\n"
+	       "compress-fast		do faster transition table compression\n"
 	       ,command);
 }
 
@@ -372,12 +372,12 @@ static int process_args(int argc, char *argv[])
 				dfaflags |= DFA_DUMP_MINIMIZE;
 			} else if (strcmp(optarg, "dfa-unreachable") == 0) {
 				dfaflags |= DFA_DUMP_UNREACHABLE;
-			} else if (strcmp(optarg, "trans-progress") == 0) {
+			} else if (strcmp(optarg, "compress-progress") == 0) {
 				dfaflags |= DFA_DUMP_TRANS_PROGRESS |
 				  DFA_DUMP_TRANS_STATS;
-			} else if (strcmp(optarg, "trans-stats") == 0) {
+			} else if (strcmp(optarg, "compress-stats") == 0) {
 				dfaflags |= DFA_DUMP_TRANS_STATS;
-			} else if (strcmp(optarg, "trans-table") == 0) {
+			} else if (strcmp(optarg, "compressed-dfa") == 0) {
 				dfaflags |= DFA_DUMP_TRANS_TABLE;
 			} else if (strcmp(optarg, "equiv") == 0) {
 				dfaflags |= DFA_DUMP_EQUIV;
@@ -424,9 +424,9 @@ static int process_args(int argc, char *argv[])
 				dfaflags |= DFA_CONTROL_MINIMIZE_HASH_PERMS;
 			} else if (strcmp(optarg, "no-hash-perms") == 0) {
 				dfaflags &= ~DFA_CONTROL_MINIMIZE_HASH_PERMS;
-			} else if (strcmp(optarg, "trans-comp-fast") == 0) {
+			} else if (strcmp(optarg, "compress-fast") == 0) {
 				dfaflags &= ~DFA_CONTROL_TRANS_HIGH;
-			} else if (strcmp(optarg, "trans-comp-high") == 0) {
+			} else if (strcmp(optarg, "compress-high") == 0) {
 				dfaflags |= DFA_CONTROL_TRANS_HIGH;
 			} else if (strcmp(optarg, "remove-unreachable") == 0) {
 				dfaflags |= DFA_CONTROL_REMOVE_UNREACHABLE;
-- 
1.7.1




More information about the AppArmor mailing list