Giter Club home page Giter Club logo

crabgrind's People

Contributors

2dav avatar kobzol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

crabgrind's Issues

Question : Output cachegrind files

Hi !

I'm pretty new with valgrind (1 hour ago ^^').

I'd like to output cachegrind file but I don't know how to manage this.

So far, I've done this:

fn run<B: Buffer>(source: Source, save_buffer: &mut B, work_buffer: &mut B) {
    let mode = cg::run_mode();
    cg::print_stacktrace!("current mode: {mode:?}");

    cg::callgrind::toggle_collect();
    cg::cachegrind::start_instrumentation();
    playground::parsers::preallocated::parser_preallocated(source, save_buffer, work_buffer)
        .unwrap();
    cg::callgrind::toggle_collect();
    cg::cachegrind::stop_instrumentation();

    if cg::monitor_command("snapshot mem.snapshot").is_ok() {
        println!("snapshot is saved to \"mem.snapshot\"");
    } else {
        println!("error")
    }
}

The main call run and does all heavy initialization.

I run everything with a

cargo valgrind run

How can I achieve this ?

With valgrind I've done

valgrind --tool=cachegrinf my_bin

But it profiles the main and poluate my analysis.

Thanks

valgrind/cachegrind.h does not exist on Arch Linux

Hi, it seems like valgrind/cachegrind.h as introduced in ad39a21 does not exist in the Arch Linux https://archlinux.org/packages/extra/x86_64/valgrind/files/ package. Should this be fixed on the Arch Linux side or in this package?

The following warnings were emitted during compilation:

warning: [email protected]: export.c:2:10: fatal error: valgrind/cachegrind.h: No such file or directory
warning: [email protected]:     2 | #include <valgrind/cachegrind.h>
warning: [email protected]:       |          ^~~~~~~~~~~~~~~~~~~~~~~
warning: [email protected]: compilation terminated.

error: failed to run custom build command for `crabgrind v0.1.10`

Caused by:
  process didn't exit successfully: `/home/moritz/Documents/project/target/release/build/crabgrind-0b7b82b707333898/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=export.c
  TARGET = Some("x86_64-unknown-linux-gnu")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-o" "/home/moritz/Documents/project/target/release/build/crabgrind-c9c6769248176212/out/export.o" "-c" "export.c"
  cargo:warning=export.c:2:10: fatal error: valgrind/cachegrind.h: No such file or directory

  cargo:warning=    2 | #include <valgrind/cachegrind.h>

  cargo:warning=      |          ^~~~~~~~~~~~~~~~~~~~~~~

  cargo:warning=compilation terminated.

  exit status: 1

  --- stderr


  error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-o" "/home/moritz/Documents/project/target/release/build/crabgrind-c9c6769248176212/out/export.o" "-c" "export.c" with args "cc" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.