metracer – Java Code Instrumentation and Stack Map Frames

Stack Map Frames in Java is a contradictory addition to the language: they speed up class loading but the same time make big troubles for a code instrumentation tools. During adoption of an ASM framework to a metracer I have stumbled with following main two issues:

  1. necessity to resolve a “common super class” during instrumentation which causes many ClassNotFoundException
  2. VerifyError exceptions with message like ‘Stack map does not match the one at exception handler’

(more…)

glClientWaitSync vs glWaitSync

Another couple of OpenGL commands which is hard to distinct is glClientWaitSync​ and glWaitSync​. Below are mnemonic helpers to get the distinction.

(more…)

glFinish vs glFlush

Had always a problem to remember a distinction between glFinish and glFlush calls. To fight the issue I’ve created two pictures which serve as a mnemonic helper.

(more…)

metracer – Logging via org.slf4j.Logger

New version 1.1.0 of metracer was released: https://github.com/kocherovms/metracer/releases/tag/v1.1.0There were many experiments, redesigns and code rewrites. Main changes are around tracing output – now it’s done via org.slf4j.Logger. (issue #8)

(more…)

sun – socket unmasker

To learn which files are opened by a given program one may use a famous spell: ls -l /proc/$PID/fd. Output of the spell will also list sockets but in a very bare and unfriendly format, e.g. '4 -> socket:[123456]'. That was making me to frustrate a lot because it’s so teasing to see what is hiding beyond this cold “123456” – a very precious information for troubleshooting!
Recently got a clue how to crack this nut. This resulted in a tiny yet powerful script named sun.sh (socket unmasker).

(more…)

Universal Guard for C++

When writing C++ code which deals with low-level system API (e.g. ::open  / ::close) it’s common to write various in-place guard classes. E.g.:

However it’s very annoying (need to replicate similar code for different APIs), inconvenient and pollutes the code. Recently I’ve realized that an universal guard could introduced using mix of   std::function and lambdas. (more…)

metracer – No Runtime Dependencies + Nice Indentation

Based on my experiments with adoption of metracer to JavaEE (link) a new version of metracer 1.0.5 was released. Source code of new 1.0.5 version: svn co https://github.com/kocherovms/develorium.com/tags/metracer_1.0.5/metracer

(more…)

metracer – Adoption to Java EE

Main target audience of a metracer are meant to be enterprise Java applications – metracer must enhance logging of such applications. As such I’ve tried to adopt metracer to a production level Java EE application which runs under WildFly AS. Speaking in terms of RPG games – tons of experience was earned :-). Results of my experiments are below.

(more…)

C++ Siberia 2015

Attended a conference C++ Siberia 2015 which took place in Novosibirsk. Had a speech about use of maven for building large C++ projects – http://meetingcpp.ru/?page_id=846. Both organization and speeches were perfect. Big thanks to Sergey Platonov (https://twitter.com/sermp/) who made this event happen!

Portal – A Technique to Render QML Windows In Many Places

In one of my QML applications I’ve faced with a need to render one of the QML window (A) inside another one (B) while keeping the window A to be visible – kind of a live thumbnailing. There are some tools within Qt framework to achieve this, e.g. QQuickItem::grabToImage or use of QQuickRenderControl, but they are slow and cumbersome. So I’ve developed my own technique called “Portal” – a reference to famous “Portal” game where you could open a wormholes to desired areas and see these areas through.

(more…)