Menu

instr fullcopy mode not incremental??

2005-01-21
2013-05-09
  • Dean Hiller

    Dean Hiller - 2005-01-21

    Ran into a case finally where I need a full jar that was instrumented.  I re-reviewed an answer you posted to this question earlier...

    http://sourceforge.net/forum/forum.php?thread_id=1143224&forum_id=373865

    I started looking at fullcopy which would be really nice, but it looks like there is no way to have fullcopy with incremental instrumentation.  I can see this to be the case when going from archive to archive, but if you are just going from class to class, couldn't incremental instrumentation be done such that un-instrumented classes are not copied every single time when they haven't changed.

    It would seem this would be the easiest solution to create an instrumented jar.....
    1. compile classes to output/classes
    2. instr fullcopy from output/classes to output/instrclasses
    3. jar up the output/instrclasses directory.

    If it had incremental instrumentation on fullcopy mode, this would still be nice and quick.  What other approaches do people use here?

    I could imaging
    1. compile to output/classes
    2. jar up output/classes to output/jar
    3. instrument to output/instrjar

    Any suggestions would be appreciated.
    thanks,
    dean

     
    • Vlad Roubtsov

      Vlad Roubtsov - 2005-02-01

      Sorry for a late reply (vacation in a remote English village, no internet :).

      Yes, fullcopy is documented to not support incremental instrumentation (Table 2.2 in "Description" section for instr tool in the reference manual).

      <quote>
      ...couldn't incremental instrumentation be done such that un-instrumented classes are not copied every single time when they haven't changed.

      It would seem this would be the easiest solution to create an instrumented jar.....
      1. compile classes to output/classes
      2. instr fullcopy from output/classes to output/instrclasses
      3. jar up the output/instrclasses directory.

      If it had incremental instrumentation on fullcopy mode, this would still be nice and quick.
      </quote>

      Hmm. Yes, that may be so. But it would also dilute the "full copy" nature of "fullcopy" mode. I wanted to keep things clear and handle class and archive files in the same fashion.

      I think I can accomplish what you want without fullcopy:

      1. compile to output/classes
      2. instr (copy, incremental) to output/instrclasses
      3. jar both output/classes and output/instrclasses in a careful way that ensures that instrclasses eclipse their uninstrumented versions. In ANT this might be done by correctly ordering <fileset>s for output/classes and output/instrclasses and perhaps using "duplicate" attribute of <jar>

      This would seem to be I/O-efficient, produce a full jar, and avoid re-building the archive file under the covers. Haven't tried it myself, though.

      Vlad.

       
    • Nobody/Anonymous

      thanks, I think this might work.  hope you had fun in the remote english village.  Places with no internet sound fun...must be a different atmosphere.
      thanks,
      dean

       

Log in to post a comment.