Questions tagged [instrumentation]

The process of inserting extra diagnostic code during compilation of a given source code.

The process of inserting extra diagnostic code during compilation of a given source code. Instrumentation can involve adding extra debugging information or providing hooks into profilers and other utilities in order to provide extra feedback to the developer.

1193 questions
15
votes
1 answer

javassist loading a class file in the pre-main method (java instrumentation)

I'm trying to load a specific class using javassist, I'm doing this inside a pre-main method as the follwoing: public byte[] transform(ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain…
ManKeer
  • 543
  • 2
  • 6
  • 27
15
votes
3 answers

proguard gradle debug build but not the tests

I enabled proguard for the debug build using: android { buildTypes { debug { runProguard true proguardFile 'proguard-debug.txt' } release { runProguard true proguardFile…
15
votes
1 answer

Debugging A Java Agent

I'm currently developing a Java Agent in order to facilitate the dynamic instrumentation of new and legacy Java Applications. It occurred to me that, as far as IDE debugging is concerned, Java Agents could be perhaps considered a special case as…
Giles Thompson
  • 1,097
  • 1
  • 9
  • 24
14
votes
4 answers

Measuring performance in Python

I'm writing a web-application in Python, I haven't decided if I want to use Flask, web.py or something else yet, and I want to be able to do profile on the live application. There seems to be very little information on how you go about implementing…
14
votes
3 answers

Asserting order of synchronization in Java

In highly concurrent systems, it can be difficult to be confident that your usage of locks is correct. Specifically, deadlocks can result if locks are acquired in an order that was not expected while being acquired in the proper order in another…
13
votes
2 answers

Why is there no test instrumentation for BroadcastReceiver?

Maybe I'm missing something. I want to write test cases for a BroadcastReceiver; specifically, it is for receiving the BOOT_COMPLETED event and setting an alarm for another receiver to handle later; it doesn't seem to be setting it properly, but the…
sosiouxme
  • 1,226
  • 16
  • 26
13
votes
2 answers

How do I log at verbose level using `System.Diags...Trace`

Okay don't laugh. In 2005 I read about tracing using System.Diagnostics namespace, it was complicated and I have used log4net and NLog ever since (and so has everyone else). Today, my app will be hosted on Windows Azure Websites and that uses our…
Luke Puplett
  • 42,091
  • 47
  • 181
  • 266
12
votes
2 answers

Instrumenting C/C++ code using LLVM

I want to write a LLVM pass to instrument every memory access. Here is what I am trying to do. Given any C/C++ program (like the one given below), I am trying to insert calls to some function, before and after every instruction that reads/writes…
Himanshu Shekhar
  • 437
  • 1
  • 5
  • 16
12
votes
1 answer

InstrumentationTestRunner: What does android:functionalTest achieve?

I am wondering what InstrumentationInfo#functionalTest is supposed to achieve. Does it have any impact on how the application environment is started?
mxk
  • 43,056
  • 28
  • 105
  • 132
12
votes
3 answers

Calculating byte-size of Java object

I am working on calculaitng the size [memory used] of a java object [hashmap] . It contains elements of different data types [at runtime] so [ no-of-elem * size-of-element] is not that good an approach. The code right now does it by series of if…
codeObserver
  • 6,521
  • 16
  • 76
  • 121
12
votes
5 answers

How to get started with WCF Performance profiling

I'm trying to figure out how to profile a WCF service so I can identify any bottlenecks. I have found a bit of information on line, but nothing that assumes no prior knowlege which is where I'm at. What are recomended FREE tools? - visual studio…
earthling
  • 5,084
  • 9
  • 46
  • 90
12
votes
1 answer

.Net Binary Deserialization Failure detection/forensics for runtime platform

I'm looking for insight on how to instrument a runtime platform to expose the source type of a Microsoft .Net binary deserialization failure. When using BinaryFormatter.Deserialize(StreamingContextStates.CrossMachine) and one of the types does not…
cbcolin
  • 371
  • 1
  • 4
  • 8
12
votes
3 answers

Spring @Autowired fails in case of Cobertura instrumented class

Question Cobertura instrumentation is breaking springs autowiring in a specific case. Does anyone know how to resolve this? Scenario I am running MVN 3.0.4 with the cobertura-maven-plugin version 2.5.1. mvn test runs without issues mvn compile,…
elyzion
  • 133
  • 2
  • 8
12
votes
2 answers

Adding code to a Java class w/ Instrumentation: ASM or BCEL?

I am writing a game engine/library in which I have an event dispatcher class which dispatches events by calling listener methods of "registered" event handler classes. One can register an event handler/listener with the event dispatcher by calling…
user1299784
  • 2,019
  • 18
  • 30
11
votes
2 answers

How to understand and learn `instrument` package of java?

Recently, I found there is a java.lang.instrument package in jdk, which is used by many frameworks to reload classes or profile. I don't find many articles of using them, is there any resource(book, article, project) to help to understand it?
Freewind
  • 193,756
  • 157
  • 432
  • 708
1 2
3
79 80