[gdal-dev] OGR C API Spy

Robert Coup robert.coup at koordinates.com
Sun Aug 31 13:44:00 PDT 2014


Excellent :)

There's obviously no nice run-time solution using the C++ API, though I
guess callgrind/linux-perf can do it - do you have any experience worth
sharing there?

Rob.


On Mon, Sep 1, 2014 at 7:14 AM, Even Rouault <even.rouault at spatialys.com>
wrote:

> Le dimanche 31 août 2014 20:50:41, Robert Coup a écrit :
> > That's cool :) Is there any particular performance penalty to compiling
> > *with* OGRAPISPY_ENABLED and then running *without*
> > OGR_API_SPY_FILE/OGR_API_SPY_SNAPSHOT_PATH
> > set?
>
> Hi Robert,
>
> Hopefully no, see for example :
>
> OGRFeatureH OGR_L_GetNextFeature( OGRLayerH hLayer )
>
> {
>     VALIDATE_POINTER1( hLayer, "OGR_L_GetNextFeature", NULL );
>
> #ifdef OGRAPISPY_ENABLED
>     if( bOGRAPISpyEnabled )
>         OGRAPISpy_L_GetNextFeature(hLayer);
> #endif
>
>     return (OGRFeatureH) ((OGRLayer *)hLayer)->GetNextFeature();
> }
>
> I cannot imagine something with less overhead. (if you exclude dynamic
> binary
> patching techniques ;-) )
>
> OGROpen() and OGR_Dr_CreateDataSource() call a tracing function that tests
> if
> the env. variable is set, and if so set the boolean bOGRAPISpyEnabled.
>
> Even
>
> >
> > Rob :)
> >
> >
> > On Sun, Aug 31, 2014 at 11:34 PM, Even Rouault <
> even.rouault at spatialys.com>
> >
> > wrote:
> > > Hi,
> > >
> > > This will not be of interest for the crowds, but mainly for OGR driver
> > > developers (and potentially also to get precise bug reports from
> users).
> > > I'm
> > > currently adding update capabilities to the MITAB driver, and while
> > > playing with QGIS, there are sometimes sequences of OGR calls that
> > > trigger bugs, but
> > > that I had issues to replicate afterwards. This spy mechanism enables
> to
> > > have
> > > recording of all relevant calls to be able to replicate them exactly
> > > afterwards.
> > >
> > > Doc to use it : http://www.gdal.org/ograpispy_8h.html
> > >
> > > Related autotest script :
> > > http://svn.osgeo.org/gdal/trunk/autotest/ogr/ograpispy.py
> > >
> > > Even
> > >
> > > --
> > > Spatialys - Geospatial professional services
> > > http://www.spatialys.com
> > > _______________________________________________
> > > gdal-dev mailing list
> > > gdal-dev at lists.osgeo.org
> > > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>



-- 

*Koordinates*PO Box 1604, Shortland St, Auckland 1140, New Zealand
Phone +64-9-966 0433 koordinates.com <https://koordinates.com/about>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140901/e7014a88/attachment.html>


More information about the gdal-dev mailing list