Skip to content

SQL query interface to C++ collections and C data structures. Also configurable as a loadable Linux kernel module and an extension to Valgrind tools.

License

Notifications You must be signed in to change notification settings

dpc-grindland/PiCO_QL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PiCO QL is a C/C++ plug-in library that sets up an SQL SELECT web-accessible online interactive interface over C/C++ data structures. SQL queries access the application's data structures in place.

For C++ applications, PiCO QL supports querying of containers compatible with the C++ SGI forward container and forward iterator concept. The container classes of the STL consist a prime example of such. PiCO QL provides concept checks to verify that containers follow the above concepts. It also supports querying of custom containers (using the USING LOOP directive) and mere objects. See the PiCO QL for C/C++ applications tutorial.

For C applications, PiCO QL supports querying of data structures like arrays and linked lists (see examples/CApp) but also any other data structure for which users will provide a loop variant (using the USING LOOP directive). It also supports querying of mere structs.

PiCO QL is also configurable as a loadable Linux kernel module. It provides both a /proc and a high-level web interface to be able to issue SQL queries against kernel data structures. Currently PiCO QL supports data structures modelling processes (such as the linked list of processes) , files, virtual memory, file system, network, namespaces, devices, busses etc. Support is extensible to include more data structures. See Fast track roll your own probes tutorial in the PiCO QL LKM wiki.

PiCO QL is also configurable as an extension to Valgrind tools, that is MemCheck, CacheGrind, and CallGrind. It provides an online interactive web interface to the data structures employed by Valgrind tools that gather memory operations metadata from an application that Valgrind instruments at the time. In other words, while Valgrind tools gather metadata about how an application is using memory, at the same time users can query the metadata using SQL queries. Synchronization issues are skipped using a simple stop-the-clock implementation to poll for a query waiting to be executed.

Table of Contents

Platforms

   Userspace (built-in examples):
     Tested under Mac OS X 10.6.7-8, 10.8.5
                  Linux 2.6
   Linux kernel module:
     Tested on:
       Architectures: x86_64, amd64
       Distributions - kernels: Fedora 18 - 3.6.9, 3.8.2, 3.9.2, 3.14.4
                                Debian 7.1 - 3.2.0, 
                                Ubuntu server 10.04 - 2.6.32
   Valgrind extension:
     Tested under Mac OS X 10.6.7-8, 10.8.5

Testing

Dependencies

  • Ruby Part of the library's source code (the parser/code generator) is written in Ruby.
  • SQLite3 While PiCO QL does not use a database or other store to copy and/or store data, it uses the virtual table (VT) mechanism of Sqlite3 to provide a relational representation of the underlying data model.
  • SWILL Once plugged in an application, PiCO QL uses the same or a separate thread and utilises the SWILL library to present a local server with a web-like, user friendly query interface. In case of the kernel configuration this interface wraps the /proc interface.
  • Boost For C++ the library accepts any container iterable in some fashion and provides concept checks (compile-time), implemented by Boost, for containers modelled after the ForwardContainer and ForwardIterator concepts.

Package Structure

  • At the examples/ directory, users can browse:
Several implemented userspace application example scenarios which can be executed effortlessly (provided the dependencies are installed in one's system):

        cd examples/ && test_all.sh

or

        cd examples/<worked-example-dir>/ && test.sh

to run the tests of a particular example. Behind the scenes test.sh does:

        ruby generator.rb pico_ql_dsl.sql [debug] [kernel] [C] [no_mem_mgt] [concept_check]

        make

with various configuration options

        ./<executable>

  • At the bin/ directory reside image files that PiCO QL uses.
  • At the doc/ directory there is the BNF of the DSL that grounds the user description syntax and the wiki pages.
  • At src/ directory, the library's source code is found.

About

SQL query interface to C++ collections and C data structures. Also configurable as a loadable Linux kernel module and an extension to Valgrind tools.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 83.8%
  • C++ 6.8%
  • Shell 5.7%
  • Ruby 1.7%
  • HTML 1.6%
  • Makefile 0.4%