endif WITH_VMWARE
if WITH_CIL
-test_programs += object-locking
+test_programs += objectlocking
endif WITH_CIL
if WITH_YAJL
CILOPTPACKAGES = -package unix,str,cil
CILOPTLIBS = -linkpkg
-object_locking_SOURCES = object-locking.ml
+object_locking_SOURCES = objectlocking.ml
%.cmx: %.ml
ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) -c $<
-object-locking: object-locking.cmx object-locking-files.txt
+objectlocking: objectlocking.cmx objectlocking-files.txt
ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
$(CILOPTLIBS) $< -o $@
-object-locking-files.txt:
+objectlocking-files.txt:
find $(top_builddir)/src/ -name '*.i' > $@
else ! WITH_CIL
-EXTRA_DIST += object-locking.ml
+EXTRA_DIST += objectlocking.ml
endif ! WITH_CIL
CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \
- object-locking-files.txt
+ objectlocking-files.txt
(*
* Analyse libvirt driver API methods for mutex locking mistakes
*
- * Copyright (C) 2008-2010, 2012 Red Hat, Inc.
+ * Copyright (C) 2008-2010, 2012, 2014 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
let () =
(* Read the list of files from "libvirt-files". *)
- let files = input_file "object-locking-files.txt" in
+ let files = input_file "objectlocking-files.txt" in
(* Load & parse each input file. *)
let files =
let driverVars = List.filter (
function
| GVar (varinfo, initinfo, loc) -> (* global variable *)
- let name = varinfo.vname in
if isDriverTable varinfo then
true
else
let driverVarFuncs = List.map (
function
| GVar (varinfo, initinfo, loc) -> (* global variable *)
- let name = varinfo.vname in
if isDriverTable varinfo then
getDriverFuncNames initinfo
else
IH.find Locking.stmtStartData st.sid in
let leakDrivers = not (VS.is_empty ld) in
let leakObjects = not (VS.is_empty lo) in
- leakDrivers or leakObjects
+ leakDrivers || leakObjects
) exitPoints in
let mistakes = List.filter (
let deadLocked = (List.length dead) > 0 in
- lockDriverOrdering or lockObjectOrdering or useDriverUnlocked or useObjectUnlocked or deadLocked
+ lockDriverOrdering || lockObjectOrdering || useDriverUnlocked || useObjectUnlocked || deadLocked
) fundec.sallstmts in
if (List.length leaks) > 0 || (List.length mistakes) > 0 then (