[cost] Disable reporting of allocation costs

Summary: We don't use allocation costs in prod at the moment. There is no plan to do so in the near future. Let's not report them anymore and also save some space in `costs-report.json`.

Reviewed By: skcho

Differential Revision: D19766828

fbshipit-source-id: 06dffa61d
master
Ezgi Çiçek 5 years ago committed by Facebook Github Bot
parent cf6073a60c
commit b5562f124a

@ -348,10 +348,7 @@ OPTIONS
disabling issue types does not make the corresponding checker not
run. Available issue types are as follows:
ALLOCATION_COMPLEXITY_INCREASE (enabled by default),
ALLOCATION_COMPLEXITY_INCREASE_COLD_START (enabled by default),
ALLOCATION_COMPLEXITY_INCREASE_UI_THREAD (enabled by default),
ANALYSIS_STOPS (disabled by default),
ANALYSIS_STOPS (disabled by default),
ARRAY_OUT_OF_BOUNDS_L1 (disabled by default),
ARRAY_OUT_OF_BOUNDS_L2 (disabled by default),
ARRAY_OUT_OF_BOUNDS_L3 (disabled by default),
@ -422,9 +419,6 @@ OPTIONS
default),
EXECUTION_TIME_COMPLEXITY_INCREASE_UI_THREAD (enabled by
default),
EXPENSIVE_ALLOCATION (disabled by default),
EXPENSIVE_ALLOCATION_COLD_START (disabled by default),
EXPENSIVE_ALLOCATION_UI_THREAD (disabled by default),
EXPENSIVE_EXECUTION_TIME (disabled by default),
EXPENSIVE_EXECUTION_TIME_COLD_START (disabled by default),
EXPENSIVE_EXECUTION_TIME_UI_THREAD (disabled by default),
@ -442,7 +436,6 @@ OPTIONS
INFERBO_ALLOC_MAY_BE_BIG (enabled by default),
INFERBO_ALLOC_MAY_BE_NEGATIVE (enabled by default),
INFERBO_ALLOC_MAY_BE_TAINTED (enabled by default),
INFINITE_ALLOCATION (disabled by default),
INFINITE_EXECUTION_TIME (disabled by default),
INHERENTLY_DANGEROUS_FUNCTION (enabled by default),
INSECURE_INTENT_HANDLING (enabled by default),
@ -524,7 +517,6 @@ OPTIONS
VECTOR_INVALIDATION (enabled by default),
WEAK_SELF_IN_NO_ESCAPE_BLOCK (enabled by default),
Wrong_argument_number (enabled by default),
ZERO_ALLOCATION (disabled by default),
ZERO_EXECUTION_TIME (disabled by default).
See also infer-report(1).

@ -77,10 +77,7 @@ OPTIONS
disabling issue types does not make the corresponding checker not
run. Available issue types are as follows:
ALLOCATION_COMPLEXITY_INCREASE (enabled by default),
ALLOCATION_COMPLEXITY_INCREASE_COLD_START (enabled by default),
ALLOCATION_COMPLEXITY_INCREASE_UI_THREAD (enabled by default),
ANALYSIS_STOPS (disabled by default),
ANALYSIS_STOPS (disabled by default),
ARRAY_OUT_OF_BOUNDS_L1 (disabled by default),
ARRAY_OUT_OF_BOUNDS_L2 (disabled by default),
ARRAY_OUT_OF_BOUNDS_L3 (disabled by default),
@ -151,9 +148,6 @@ OPTIONS
default),
EXECUTION_TIME_COMPLEXITY_INCREASE_UI_THREAD (enabled by
default),
EXPENSIVE_ALLOCATION (disabled by default),
EXPENSIVE_ALLOCATION_COLD_START (disabled by default),
EXPENSIVE_ALLOCATION_UI_THREAD (disabled by default),
EXPENSIVE_EXECUTION_TIME (disabled by default),
EXPENSIVE_EXECUTION_TIME_COLD_START (disabled by default),
EXPENSIVE_EXECUTION_TIME_UI_THREAD (disabled by default),
@ -171,7 +165,6 @@ OPTIONS
INFERBO_ALLOC_MAY_BE_BIG (enabled by default),
INFERBO_ALLOC_MAY_BE_NEGATIVE (enabled by default),
INFERBO_ALLOC_MAY_BE_TAINTED (enabled by default),
INFINITE_ALLOCATION (disabled by default),
INFINITE_EXECUTION_TIME (disabled by default),
INHERENTLY_DANGEROUS_FUNCTION (enabled by default),
INSECURE_INTENT_HANDLING (enabled by default),
@ -253,7 +246,6 @@ OPTIONS
VECTOR_INVALIDATION (enabled by default),
WEAK_SELF_IN_NO_ESCAPE_BLOCK (enabled by default),
Wrong_argument_number (enabled by default),
ZERO_ALLOCATION (disabled by default),
ZERO_EXECUTION_TIME (disabled by default).

@ -348,10 +348,7 @@ OPTIONS
disabling issue types does not make the corresponding checker not
run. Available issue types are as follows:
ALLOCATION_COMPLEXITY_INCREASE (enabled by default),
ALLOCATION_COMPLEXITY_INCREASE_COLD_START (enabled by default),
ALLOCATION_COMPLEXITY_INCREASE_UI_THREAD (enabled by default),
ANALYSIS_STOPS (disabled by default),
ANALYSIS_STOPS (disabled by default),
ARRAY_OUT_OF_BOUNDS_L1 (disabled by default),
ARRAY_OUT_OF_BOUNDS_L2 (disabled by default),
ARRAY_OUT_OF_BOUNDS_L3 (disabled by default),
@ -422,9 +419,6 @@ OPTIONS
default),
EXECUTION_TIME_COMPLEXITY_INCREASE_UI_THREAD (enabled by
default),
EXPENSIVE_ALLOCATION (disabled by default),
EXPENSIVE_ALLOCATION_COLD_START (disabled by default),
EXPENSIVE_ALLOCATION_UI_THREAD (disabled by default),
EXPENSIVE_EXECUTION_TIME (disabled by default),
EXPENSIVE_EXECUTION_TIME_COLD_START (disabled by default),
EXPENSIVE_EXECUTION_TIME_UI_THREAD (disabled by default),
@ -442,7 +436,6 @@ OPTIONS
INFERBO_ALLOC_MAY_BE_BIG (enabled by default),
INFERBO_ALLOC_MAY_BE_NEGATIVE (enabled by default),
INFERBO_ALLOC_MAY_BE_TAINTED (enabled by default),
INFINITE_ALLOCATION (disabled by default),
INFINITE_EXECUTION_TIME (disabled by default),
INHERENTLY_DANGEROUS_FUNCTION (enabled by default),
INSECURE_INTENT_HANDLING (enabled by default),
@ -524,7 +517,6 @@ OPTIONS
VECTOR_INVALIDATION (enabled by default),
WEAK_SELF_IN_NO_ESCAPE_BLOCK (enabled by default),
Wrong_argument_number (enabled by default),
ZERO_ALLOCATION (disabled by default),
ZERO_EXECUTION_TIME (disabled by default).
See also infer-report(1).

@ -76,7 +76,6 @@ type cost_item = {
procedure_name : string;
procedure_id : string;
is_on_ui_thread : bool;
alloc_cost : cost_info;
exec_cost : cost_info;
}

@ -347,8 +347,7 @@ module JsonCostsPrinter = MakeJsonListPrinter (struct
; procedure_name= Procname.get_method proc_name
; procedure_id= procedure_id_of_procname proc_name
; is_on_ui_thread
; exec_cost= cost_info (CostDomain.get_cost_kind CostKind.OperationCost post)
; alloc_cost= cost_info (CostDomain.get_cost_kind CostKind.AllocationCost post) }
; exec_cost= cost_info (CostDomain.get_cost_kind CostKind.OperationCost post) }
in
Some (Jsonbug_j.string_of_cost_item cost_item)
| _ ->

@ -44,7 +44,7 @@ let to_json_cost_info c = function
| OperationCost ->
c.Jsonbug_t.exec_cost
| AllocationCost ->
c.Jsonbug_t.alloc_cost
assert false
| IOCost ->
assert false
@ -55,5 +55,4 @@ let to_threshold = function OperationCost -> Some 200 | AllocationCost -> Some 3
type kind_spec = {kind: t; (* for non-diff analysis *) top_and_bottom: bool}
let enabled_cost_kinds =
[{kind= OperationCost; top_and_bottom= true}; {kind= AllocationCost; top_and_bottom= false}]
let enabled_cost_kinds = [{kind= OperationCost; top_and_bottom= true}]

@ -1 +1 @@
{"top":{"current":4,"previous":2},"zero":{"current":21,"previous":19},"degrees":[{"degree":0,"current":11,"previous":10},{"degree":100,"current":4,"previous":5},{"degree":101,"current":4,"previous":0},{"degree":200,"current":2,"previous":4}]}
{"top":{"current":4,"previous":2},"zero":{"current":0,"previous":0},"degrees":[{"degree":0,"current":10,"previous":9},{"degree":100,"current":3,"previous":5},{"degree":101,"current":4,"previous":0},{"degree":200,"current":2,"previous":4}]}

@ -3,7 +3,6 @@ INFINITE_EXECUTION_TIME, no_bucket, src/DiffExample.java, DiffExample.f1(int):vo
EXECUTION_TIME_COMPLEXITY_INCREASE, no_bucket, src/DiffExample.java, DiffExample.f4(int):int, 0, [Updated Cost is 6 + 5 ⋅ k (degree is 1),{k},Loop at line 57]
EXECUTION_TIME_COMPLEXITY_INCREASE, no_bucket, src/DiffExample.java, DiffExample.f5(java.util.ArrayList):void, 0, [Updated Cost is 2 + list.length × log(list.length) (degree is 1 + 1⋅log),{list.length},Modeled call to Collections.sort,{list.length},Modeled call to Collections.sort]
INFINITE_EXECUTION_TIME, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f1(int):void, 0, [Unbounded loop,Loop at line 26]
ALLOCATION_COMPLEXITY_INCREASE_COLD_START, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f4(int):int, 0, [Updated Cost is k (degree is 1),{k},Loop at line 45]
EXECUTION_TIME_COMPLEXITY_INCREASE_COLD_START, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f4(int):int, 0, [Updated Cost is 6 + 7 ⋅ k (degree is 1),{k},Loop at line 45]
EXECUTION_TIME_COMPLEXITY_INCREASE, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f5(java.util.ArrayList):void, 0, [Updated Cost is 2 + list.length × log(list.length) (degree is 1 + 1⋅log),{list.length},Modeled call to Collections.sort,{list.length},Modeled call to Collections.sort]
EXECUTION_TIME_COMPLEXITY_INCREASE_UI_THREAD, no_bucket, src/DiffExampleUIThread.java, DiffExampleUIThread.f2(int):void, 0, [Updated Cost is 5 + 5 ⋅ x (degree is 1),{x},Loop at line 27]

@ -1 +1 @@
{"top":{"current":0,"previous":0},"zero":{"current":7,"previous":6},"degrees":[{"degree":0,"current":3,"previous":4},{"degree":100,"current":4,"previous":1},{"degree":200,"current":0,"previous":1}]}
{"top":{"current":0,"previous":0},"zero":{"current":0,"previous":0},"degrees":[{"degree":0,"current":3,"previous":4},{"degree":100,"current":4,"previous":1},{"degree":200,"current":0,"previous":1}]}

@ -1,5 +1,3 @@
codetoanalyze/java/performance/A.java, B$BArray.error():void, 3, EXPENSIVE_ALLOCATION, no_bucket, ERROR, [with estimated cost 4, O(1), degree = 0]
codetoanalyze/java/performance/A.java, B.error():void, 3, EXPENSIVE_ALLOCATION, no_bucket, ERROR, [with estimated cost 4, O(1), degree = 0]
codetoanalyze/java/performance/AndroidXCollectionTest.java, AndroidXCollectionTest.iterate_over_sparsearraycompat_linear(androidx.collection.SparseArrayCompat):void, 0, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 5 + 5 ⋅ sa.length, O(sa.length), degree = 1,{sa.length},Loop at line 12]
codetoanalyze/java/performance/Array.java, codetoanalyze.java.performance.Array.array_access_overrun_bad():void, 3, BUFFER_OVERRUN_L2, no_bucket, ERROR, [<Offset trace>,Assignment,<Length trace>,Array declaration,Array access: Offset: [2, 8] Size: 8]
codetoanalyze/java/performance/Array.java, codetoanalyze.java.performance.Array.array_access_weird_ok(long[],int):void, 0, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 2 + 13 ⋅ length, O(length), degree = 1,{length},Loop at line 30]
@ -20,7 +18,6 @@ codetoanalyze/java/performance/ArrayCost.java, ArrayCost.ArrayCost(int[]):void,
codetoanalyze/java/performance/ArrayCost.java, ArrayCost.isPowOfTwo_FP(int):boolean, 3, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 883, O(1), degree = 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add3_overrun_bad():void, 4, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Through,Through,Array access: Offset added: 4 Size: 3]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_addAll_bad():void, 9, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Through,Through,Through,Array access: Offset added: 5 Size: 4]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add_in_nested_loop_constant():void, 0, EXPENSIVE_ALLOCATION, no_bucket, ERROR, [with estimated cost 10, O(1), degree = 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_add_in_nested_loop_constant():void, 0, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 1772, O(1), degree = 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_overrun_bad():void, 1, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Array access: Offset added: 1 Size: 0]
codetoanalyze/java/performance/ArrayListTest.java, ArrayListTest.arraylist_empty_underrun_bad():void, 1, BUFFER_OVERRUN_L1, no_bucket, ERROR, [<Length trace>,Array declaration,Array access: Offset added: -1 Size: 0]
@ -131,7 +128,6 @@ codetoanalyze/java/performance/Invariant.java, Invariant.formal_not_invariant_FP
codetoanalyze/java/performance/Invariant.java, Invariant.list_size_invariant(java.util.List):void, 0, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 2 + 5 ⋅ items.length + 3 ⋅ (items.length + 1), O(items.length), degree = 1,{items.length + 1},Loop at line 66,{items.length},Loop at line 66]
codetoanalyze/java/performance/Invariant.java, Invariant.local_not_invariant_FP(int):void, 2, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 3 + 12 ⋅ (size + 5) + 7 ⋅ (size + 5) × (5+min(1, size)) + 4 ⋅ (5+min(0, size)), O(size²), degree = 2,{5+min(0, size)},Loop at line 46,{5+min(1, size)},Loop at line 46,{size + 5},Loop at line 46]
codetoanalyze/java/performance/Invariant.java, Invariant.x_is_invariant_ok(int):void, 6, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 8 + 6 ⋅ (size + 20), O(size), degree = 1,{size + 20},Loop at line 19]
codetoanalyze/java/performance/IteratorTest.java, IteratorTest$Color.<clinit>():void, -1, EXPENSIVE_ALLOCATION, no_bucket, ERROR, [with estimated cost 4, O(1), degree = 0]
codetoanalyze/java/performance/IteratorTest.java, IteratorTest.appendTo(java.util.Iterator):void, 0, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 1 + 10 ⋅ parts.length + 3 ⋅ (parts.length + 1), O(parts.length), degree = 1,{parts.length + 1},Loop at line 12,{parts.length},Loop at line 12]
codetoanalyze/java/performance/IteratorTest.java, IteratorTest.linearIterable(java.lang.Iterable):void, 0, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 9 + 10 ⋅ elements.length + 3 ⋅ (elements.length + 1), O(elements.length), degree = 1,{elements.length + 1},call to void IteratorTest.appendTo(Iterator),Loop at line 12,{elements.length},call to void IteratorTest.appendTo(Iterator),Loop at line 12]
codetoanalyze/java/performance/JsonArray.java, libraries.marauder.analytics.utils.json.JsonArray.addStringEntry(java.lang.String):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Call to void JsonUtils.serialize(StringBuilder,String),Call to void JsonUtils.escape(StringBuilder,String),Unbounded loop,Loop at line 13]
@ -212,9 +208,7 @@ codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.call_conc
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.call_concrete_func_linear_FP(UnknownCallsTest$AbstractC):void, 1, BUFFER_OVERRUN_U5, no_bucket, ERROR, [<Length trace>,Unknown value from: int[] UnknownCallsTest$AbstractC.abstract_func(),Assignment,Array access: Offset: [-oo, +oo] Size: [0, +oo]]
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.call_concrete_func_linear_FP(UnknownCallsTest$AbstractC):void, 1, INTEGER_OVERFLOW_U5, no_bucket, ERROR, [<LHS trace>,Unknown value from: int[] UnknownCallsTest$AbstractC.abstract_func(),Binary operation: ([0, +oo] + 1):signed32]
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.call_loop_over_charArray_FP(java.lang.StringBuilder,java.lang.String):void, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Call to void UnknownCallsTest.loop_over_charArray_FP(StringBuilder,String),Unbounded loop,Loop at line 51]
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.call_may_throw_exception_constant():void, 0, EXPENSIVE_ALLOCATION, no_bucket, ERROR, [with estimated cost 11, O(1), degree = 0]
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.call_may_throw_exception_constant():void, 0, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 217, O(1), degree = 0]
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.call_throw_exception_linear():void, 0, EXPENSIVE_ALLOCATION, no_bucket, ERROR, [with estimated cost (1+max(0, UnknownCallsTest.throw_exception().ub)), O(UnknownCallsTest.throw_exception().ub), degree = 1,{1+max(0, UnknownCallsTest.throw_exception().ub)},Loop at line 71]
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.call_throw_exception_linear():void, 0, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 2 + 5 ⋅ UnknownCallsTest.throw_exception().ub + 8 ⋅ (1+max(0, UnknownCallsTest.throw_exception().ub)), O(UnknownCallsTest.throw_exception().ub), degree = 1,{1+max(0, UnknownCallsTest.throw_exception().ub)},Loop at line 71,{UnknownCallsTest.throw_exception().ub},Loop at line 71]
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.jsonArray_linear(org.json.JSONArray):void, 1, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 5 + 5 ⋅ jsonArray.length, O(jsonArray.length), degree = 1,{jsonArray.length},Loop at line 18]
codetoanalyze/java/performance/UnknownCallsTest.java, UnknownCallsTest.loop_over_charArray_FP(java.lang.StringBuilder,java.lang.String):void, 0, BUFFER_OVERRUN_U5, no_bucket, ERROR, [<Offset trace>,Assignment,<Length trace>,Unknown value from: char[] String.toCharArray(),Array access: Offset: [-oo, +oo] (⇐ [-oo, +oo] + [0, +oo]) Size: [0, +oo]]

@ -1,5 +1,3 @@
codetoanalyze/objc/performance/araii.m, Araii::initWithBuffer, 4, EXPENSIVE_ALLOCATION, no_bucket, ERROR, [with estimated cost 4, O(1), degree = 0]
codetoanalyze/objc/performance/araii.m, memory_leak_raii_main, 1, EXPENSIVE_ALLOCATION, no_bucket, ERROR, [with estimated cost 5, O(1), degree = 0]
codetoanalyze/objc/performance/cf.m, array_count_linear, 2, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 5 + 3 ⋅ arr.length + 2 ⋅ (arr.length + 1), O(arr.length), degree = 1,{arr.length + 1},Loop at line 18, column 3,{arr.length},Loop at line 18, column 3]
codetoanalyze/objc/performance/cf.m, cf_array_create_copy_linear, 6, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 1009, O(1), degree = 0]
codetoanalyze/objc/performance/cf.m, cf_array_create_linear, 13, EXPENSIVE_EXECUTION_TIME, no_bucket, ERROR, [with estimated cost 10 + 3 ⋅ x + 2 ⋅ (1+max(0, x)), O(x), degree = 1,{1+max(0, x)},Loop at line 41, column 3,{x},Loop at line 41, column 3]

Loading…
Cancel
Save