Experimental automated 'follower' code.
[virt-mem.git] / extract / codegen / code_generation.mli
index c2e1271..e359647 100644 (file)
@@ -76,12 +76,29 @@ val generate_parsers : (string * Struct_classify.parser_ list) list ->
        by the contents of the returned hash table in {!output_implem}.
     *)
 
+(** {2 Generate followers}
+
+    The "followers" are functions which recursively follow every
+    structure in the kernel, starting out at known root structures
+    such as [init_task] and [init_net].  Their job is to (a) find
+    every kernel structure, (b) ensure it is loaded into our
+    memory map, (c) produce a map of address -> structure.
+*)
+
+val generate_followers :
+  (string * ((Pahole_parser.info * Pahole_parser.structure) list
+            * Struct_classify.shape_field_struct list
+            * Struct_classify.sfhash * Struct_classify.pahash)) list ->
+  code
+  (** [generate_followers] generates the follower functions. *)
+
 (** {2 Output final files} *)
 
 val output_interf : output_file:string ->
   Camlp4.PreCast.Syntax.Ast.sig_item ->
   Camlp4.PreCast.Syntax.Ast.sig_item ->
   Camlp4.PreCast.Syntax.Ast.sig_item ->
+  Camlp4.PreCast.Syntax.Ast.sig_item ->
   unit
   (** Output the interface file. *)
 
@@ -90,5 +107,6 @@ val output_implem : output_file:string ->
   Camlp4.PreCast.Syntax.Ast.str_item ->
   Camlp4.PreCast.Syntax.Ast.str_item ->
   (string, string) Hashtbl.t ->
+  Camlp4.PreCast.Syntax.Ast.str_item ->
   unit
   (** Output the implementation file. *)