Skip to content

Commit

Permalink
Prefix dune__exe in test and short paths in test output
Browse files Browse the repository at this point in the history
  • Loading branch information
gretay-js committed Oct 23, 2019
1 parent bfeb767 commit 567654a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 149 deletions.
18 changes: 5 additions & 13 deletions test/blackbox-tests/test-cases/fdo/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,8 @@ guaranteed to fail if ocamlfdo attempts to load the profile.
[1]
$ OCAMLFDO_USE_PROFILE=if-exists dune build src/foo.exe --workspace dune-workspace.4
$ OCAMLFDO_USE_PROFILE=if-exists dune build src-with-profile/foo.exe --workspace dune-workspace.5 2>&1 | grep -v 'new crc'
ocamlfdo src-with-profile/.foo.eobjs/native/foo.cmir-linear-fdo [fdo] (exit 65)
(cd _build/fdo/src-with-profile && /usr/local/home/gyorsh/.opam/dunefdo/bin/ocamlfdo opt .foo.eobjs/native/foo.cmir-linear -fdo-profile foo.exe.fdo-profile -md5-unit -reorder-blocks opt -q)
Error: Linear IR for Foo from file .foo.eobjs/native/foo.cmir-linear does not match the version of this IR used for creating the profiled binary.
old crc: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
$ OCAMLFDO_USE_PROFILE=if-exists dune build src-with-profile/foo.exe --workspace dune-workspace.5 2>&1 | grep 'Error: '
Error: Linear IR for Dune__exe__Foo from file .foo.eobjs/native/dune__exe__Foo.cmir-linear does not match the version of this IR used for creating the profiled binary.
$ OCAMLFDO_USE_PROFILE=never dune build src/foo.exe --workspace dune-workspace.4
Expand All @@ -84,18 +80,14 @@ guaranteed to fail if ocamlfdo attempts to load the profile.
src/foo.exe.fdo-profile does not exist.
[1]
$ OCAMLFDO_USE_PROFILE=always dune build src-with-profile/foo.exe --workspace dune-workspace.5 2>&1 | grep -v 'new crc'
ocamlfdo src-with-profile/.foo.eobjs/native/foo.cmir-linear-fdo [fdo] (exit 65)
(cd _build/fdo/src-with-profile && /usr/local/home/gyorsh/.opam/dunefdo/bin/ocamlfdo opt .foo.eobjs/native/foo.cmir-linear -fdo-profile foo.exe.fdo-profile -md5-unit -reorder-blocks opt -q)
Error: Linear IR for Foo from file .foo.eobjs/native/foo.cmir-linear does not match the version of this IR used for creating the profiled binary.
old crc: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
$ OCAMLFDO_USE_PROFILE=always dune build src-with-profile/foo.exe --workspace dune-workspace.5 2>&1 | grep 'Error: '
Error: Linear IR for Dune__exe__Foo from file .foo.eobjs/native/dune__exe__Foo.cmir-linear does not match the version of this IR used for creating the profiled binary.
Check OCAMLFDO_FLAGS are passed on to "ocamlfdo opt"
$ OCAMLFDO_FLAGS="-help" dune build src/foo.exe --workspace dune-workspace.4 2>&1 | head -n 4
ocamlfdo src/.foo.eobjs/native/foo.cmir-linear-fdo [fdo]
ocamlfdo src/.foo.eobjs/native/dune__exe__Foo.cmir-linear-fdo [fdo]
Use a profile to optimize intermediate representation of the program.
ocamlfdo opt [INPUT ...]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,130 +1,4 @@
((addr2loc
((-1479002897 ((addr -1479002897) (rel ()) (dbg ())))
(-1479002288 ((addr -1479002288) (rel ()) (dbg ())))
(33758480
((addr 33758480) (rel (((id 5) (offset 0) (label ())))) (dbg ())))
(33759360
((addr 33759360) (rel (((id 4) (offset 0) (label ())))) (dbg ())))
(33759386
((addr 33759386) (rel (((id 4) (offset 26) (label ())))) (dbg ())))
(33759393
((addr 33759393) (rel (((id 4) (offset 33) (label ())))) (dbg ())))
(33759433
((addr 33759433) (rel (((id 4) (offset 73) (label ())))) (dbg ())))
(33761582
((addr 33761582) (rel (((id 1) (offset 110) (label ())))) (dbg ())))
(33761600
((addr 33761600) (rel (((id 1) (offset 128) (label ())))) (dbg ())))
(33761631
((addr 33761631) (rel (((id 1) (offset 159) (label ())))) (dbg ())))
(33761726
((addr 33761726) (rel (((id 1) (offset 254) (label ())))) (dbg ())))
(33761731
((addr 33761731) (rel (((id 1) (offset 259) (label ())))) (dbg ())))
(33761736
((addr 33761736) (rel (((id 1) (offset 264) (label ())))) (dbg ())))
(33761741
((addr 33761741) (rel (((id 1) (offset 269) (label ())))) (dbg ())))
(33761746
((addr 33761746) (rel (((id 1) (offset 274) (label ())))) (dbg ())))
(33761751
((addr 33761751) (rel (((id 1) (offset 279) (label ())))) (dbg ())))
(33761759
((addr 33761759) (rel (((id 1) (offset 287) (label ())))) (dbg ())))
(33764112
((addr 33764112) (rel (((id 2) (offset 0) (label ())))) (dbg ())))
(33764210
((addr 33764210) (rel (((id 2) (offset 98) (label ())))) (dbg ())))
(33764275
((addr 33764275) (rel (((id 2) (offset 163) (label ())))) (dbg ())))
(33764305
((addr 33764305) (rel (((id 2) (offset 193) (label ())))) (dbg ())))
(33764680
((addr 33764680) (rel (((id 0) (offset 40) (label ())))) (dbg ())))
(33764690
((addr 33764690) (rel (((id 0) (offset 50) (label ())))) (dbg ())))
(33764700
((addr 33764700) (rel (((id 0) (offset 60) (label ())))) (dbg ())))
(33764705
((addr 33764705) (rel (((id 0) (offset 65) (label ())))) (dbg ())))
(33764707
((addr 33764707) (rel (((id 0) (offset 67) (label ())))) (dbg ())))
(33764720
((addr 33764720) (rel (((id 0) (offset 80) (label ())))) (dbg ())))
(33764726
((addr 33764726) (rel (((id 0) (offset 86) (label ())))) (dbg ())))
(33812615
((addr 33812615) (rel (((id 3) (offset 135) (label ())))) (dbg ())))
(33812661
((addr 33812661) (rel (((id 3) (offset 181) (label ())))) (dbg ())))))
(name2id
((caml_init_gc 3) (caml_init_major_heap 5) (caml_page_table_add 0)
(caml_page_table_modify 2) (caml_set_minor_heap_size 1) (reset_table 4)))
(functions
((0
((id 0) (name caml_page_table_add) (start 33764640) (finish 33764727)
(count 15) (has_linearids false) (malformed_traces 0)
(agg
((instructions ())
(branches
(((33764305 33764705) 4) ((33764690 33764720) 1)
((33764700 33764112) 4) ((33764707 33764680) 5)
((33764726 33761582) 1)))
(mispredicts (((33764690 33764720) 1)))
(traces
(((33764680 33764690) 1) ((33764680 33764700) 4)
((33764705 33764707) 4) ((33764720 33764726) 1)))))))
(1
((id 1) (name caml_set_minor_heap_size) (start 33761472)
(finish 33761765) (count 9) (has_linearids false) (malformed_traces 0)
(agg
((instructions ())
(branches
(((33759433 33761731) 1) ((33759433 33761741) 1)
((33759433 33761751) 1) ((33761600 33761631) 1)
((33761726 33759360) 1) ((33761736 33759360) 1)
((33761746 33759360) 1) ((33761759 33812615) 1)
((33764726 33761582) 1)))
(mispredicts (((33761600 33761631) 1) ((33761759 33812615) 1)))
(traces
(((33761582 33761600) 1) ((33761631 33761726) 1)
((33761731 33761736) 1) ((33761741 33761746) 1)
((33761751 33761759) 1)))))))
(2
((id 2) (name caml_page_table_modify) (start 33764112) (finish 33764630)
(count 12) (has_linearids false) (malformed_traces 0)
(agg
((instructions ())
(branches
(((33764210 33764275) 4) ((33764305 33764705) 4)
((33764700 33764112) 4)))
(mispredicts ())
(traces (((33764112 33764210) 4) ((33764275 33764305) 4)))))))
(3
((id 3) (name caml_init_gc) (start 33812480) (finish 33813023) (count 2)
(has_linearids false) (malformed_traces 0)
(agg
((instructions ())
(branches (((33761759 33812615) 1) ((33812661 33758480) 1)))
(mispredicts (((33761759 33812615) 1)))
(traces (((33812615 33812661) 1)))))))
(4
((id 4) (name reset_table) (start 33759360) (finish 33759434) (count 9)
(has_linearids false) (malformed_traces 0)
(agg
((instructions ())
(branches
(((33759386 33759393) 3) ((33759433 33761731) 1)
((33759433 33761741) 1) ((33759433 33761751) 1)
((33761726 33759360) 1) ((33761736 33759360) 1)
((33761746 33759360) 1)))
(mispredicts (((33759386 33759393) 2)))
(traces (((33759360 33759386) 3) ((33759393 33759433) 3)))))))
(5
((id 5) (name caml_init_major_heap) (start 33758480) (finish 33758887)
(count 2) (has_linearids false) (malformed_traces 0)
(agg
((instructions ())
(branches (((-1479002897 33758480) 1) ((33812661 33758480) 1)))
(mispredicts ()) (traces ())))))))
(execounts ()) (crcs ((Foo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa))))
((addr2loc ())
(name2id ())
(functions ())
(execounts ()) (crcs ((Dune__exe__Foo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa))))
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
*(.text.caml_page_table_add)
*(.text.caml_page_table_modify)
*(.text.caml_set_minor_heap_size)
*(.text.reset_table)
*(.text.caml_init_gc)
*(.text.caml_init_major_heap)

0 comments on commit 567654a

Please sign in to comment.