plasma-umass / coz

Coz: Causal Profiling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to see any results when the dynamic library is loaded on demand

rteja opened this issue · comments

I am unable to see any useful result when the dynamic library is loaded during execution time.

Please explain in more detail what is happening, including command line used (e.g., coz run --- ), and how you placed progress points. The results will appear in a file called profile.coz, which you will load when plotting (coz plot).

I have used coz run --- ./program . I have placed progress points in some functions that dynamic library contains. While the MAIN program is not built from debug symbols, dynamic library is built from debug symbols.

Only result I see in profile.coz is startup-time and run-time

Are you loading the library with dlopen rather than linking against the shared library? If not, a short example that illustrates the issue would be helpful.

I have the same issue with the provided example

$ sudo apt-get install coz-profiler
$ g++ histogram-pthread.c -g -gdwarf-3 -ldl -lpthread
$ coz run --- ./a.out test.bmp
$ cat profile.coz 
startup time=1668121661276775011
runtime time=131545581

$ g++ --version
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal

I get the same result using Github CI

https://github.com/Delaunay/coz/actions/runs/3441236143/jobs/5740560689#step:5:821

name: benchmark

on: [push]

jobs:
  histogram:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Set up Python 3.9
        uses: actions/setup-python@v2
        with:
          python-version: 3.9

      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install coz-profiler g++

      - name: Compile histogram
        run: |
          cd benchmarks/histogram
          g++ histogram-pthread.c -g -gdwarf-3 -ldl -lpthread
          sudo sh -c 'echo 1 >/proc/sys/kernel/perf_event_paranoid'
          coz run --- ./a.out test.bmp
          echo '--- COZ PROFILE ---'
          cat profile.coz

The issue is, as always it seems, with libelfin, compiling coz & libelfin from source seems to make it work although I am not sure what is the expected output.

https://github.com/Delaunay/coz/actions/runs/3441393337/jobs/5740875977#step:7:820

--- COZ PROFILE ---
startup	time=1668125163785826645
experiment	selected=/home/runner/work/coz/coz/benchmarks/histogram/histogram-pthread.c:118	speedup=0.50	duration=395436510	selected-samples=397
throughput-point	name=histogram-pthread.c:129	delta=9671411
runtime	time=530610912
samples	location=/home/runner/work/coz/coz/benchmarks/histogram/histogram-pthread.c:117	count=11
samples	location=/home/runner/work/coz/coz/benchmarks/histogram/histogram-pthread.c:118	count=414
samples	location=/home/runner/work/coz/coz/benchmarks/histogram/histogram-pthread.c:120	count=4
samples	location=/home/runner/work/coz/coz/benchmarks/histogram/histogram-pthread.c:121	count=8
samples	location=/home/runner/work/coz/coz/benchmarks/histogram/histogram-pthread.c:123	count=11
samples	location=/home/runner/work/coz/coz/benchmarks/histogram/histogram-pthread.c:124	count=4
samples	location=/home/runner/work/coz/coz/benchmarks/histogram/histogram-pthread.c:126	count=12
samples	location=/home/runner/work/coz/coz/benchmarks/histogram/histogram-pthread.c:127	count=4
samples	location=/home/runner/work/coz/coz/benchmarks/histogram/histogram-pthread.c:129	count=13