Loading ...
Sorry, an error occurred while loading the content.

Probe mode, timer thread, ACE thread/comm library in PinTool

Expand Messages
  • bitmolot
    Hello, I m testing a distributed application by employing two simulators. One simulator submits a UDP message to the app, the other bounces the message via the
    Message 1 of 4 , May 17, 2010
    View Source
    • 0 Attachment
      Hello, I'm testing a distributed application by employing two
      simulators. One simulator submits a UDP message to the app, the other
      bounces the message via the same app instance back to the original
      simulator. This is one of the testing scenarios.
      I'm using thread and communication wrappers from the ACE library. The
      library is statically linked in.

      To simplify the deployment/testing process, I'd like to use Pin to instrument the app in probe mode. I should be able to send messages at predefined intervals. This would imply the usage of a separate timer thread within my PinTool (a separate process would defeat the purpose of Pin's usage).
      In FAQ it states that I cannot create a private PinTool threads; guess
      it can be rephrased as "cannot create a private thread that will not
      cause problems"?

      So, is there a way (and what is it) or is it even possible to use a
      thread/comm library without problems in probe mode? Any other
      suggestions on how I can solve the problem?

      My testing machine:
      Core 2 Duo
      Visual Studio 9.0.30729.1
      pin-2.8-33586-msvc9-ia32_intel64-windows

      Thanks
    • tevi.devor
      In the latest pin (33586) kit look at the PIN_SpawnInternalThread API. Also look at MemTrace membuffer_threadpool.cpp for example of how to use this API and
      Message 2 of 4 , May 18, 2010
      View Source
      • 0 Attachment
        In the latest pin (33586) kit look at the PIN_SpawnInternalThread API.
        Also look at MemTrace\membuffer_threadpool.cpp for example of how to use this API and related APIs to utilize and manage tool-internal threads.
        Also follow the "cgo tutorial slides are posted" link at http://www.pintool.org and look at the slides that describe membuffer_threadpool.
        Also look at other tools in the kit that use the PIN_SpawnInternalThread API.

        --- In pinheads@yahoogroups.com, "bitmolot" <bitmolot@...> wrote:
        >
        > Hello, I'm testing a distributed application by employing two
        > simulators. One simulator submits a UDP message to the app, the other
        > bounces the message via the same app instance back to the original
        > simulator. This is one of the testing scenarios.
        > I'm using thread and communication wrappers from the ACE library. The
        > library is statically linked in.
        >
        > To simplify the deployment/testing process, I'd like to use Pin to instrument the app in probe mode. I should be able to send messages at predefined intervals. This would imply the usage of a separate timer thread within my PinTool (a separate process would defeat the purpose of Pin's usage).
        > In FAQ it states that I cannot create a private PinTool threads; guess
        > it can be rephrased as "cannot create a private thread that will not
        > cause problems"?
        >
        > So, is there a way (and what is it) or is it even possible to use a
        > thread/comm library without problems in probe mode? Any other
        > suggestions on how I can solve the problem?
        >
        > My testing machine:
        > Core 2 Duo
        > Visual Studio 9.0.30729.1
        > pin-2.8-33586-msvc9-ia32_intel64-windows
        >
        > Thanks
        >
      • tevi.devor
        Re-reading your message - I see you are in probe-mode. My answer pertained to Jit mode only. In probe-mode Pin is not aware of threads, so you should be able
        Message 3 of 4 , May 18, 2010
        View Source
        • 0 Attachment
          Re-reading your message - I see you are in probe-mode.
          My answer pertained to Jit mode only.

          In probe-mode Pin is not aware of threads, so you should be able to create private pintool threads in probe-mode windows pintools using the native windows API. Be aware that any probes you insert will be executed by these private threads if they call the probed functions.

          --- In pinheads@yahoogroups.com, "tevi.devor" <tevi.devor@...> wrote:
          >
          > In the latest pin (33586) kit look at the PIN_SpawnInternalThread API.
          > Also look at MemTrace\membuffer_threadpool.cpp for example of how to use this API and related APIs to utilize and manage tool-internal threads.
          > Also follow the "cgo tutorial slides are posted" link at http://www.pintool.org and look at the slides that describe membuffer_threadpool.
          > Also look at other tools in the kit that use the PIN_SpawnInternalThread API.
          >
          > --- In pinheads@yahoogroups.com, "bitmolot" <bitmolot@> wrote:
          > >
          > > Hello, I'm testing a distributed application by employing two
          > > simulators. One simulator submits a UDP message to the app, the other
          > > bounces the message via the same app instance back to the original
          > > simulator. This is one of the testing scenarios.
          > > I'm using thread and communication wrappers from the ACE library. The
          > > library is statically linked in.
          > >
          > > To simplify the deployment/testing process, I'd like to use Pin to instrument the app in probe mode. I should be able to send messages at predefined intervals. This would imply the usage of a separate timer thread within my PinTool (a separate process would defeat the purpose of Pin's usage).
          > > In FAQ it states that I cannot create a private PinTool threads; guess
          > > it can be rephrased as "cannot create a private thread that will not
          > > cause problems"?
          > >
          > > So, is there a way (and what is it) or is it even possible to use a
          > > thread/comm library without problems in probe mode? Any other
          > > suggestions on how I can solve the problem?
          > >
          > > My testing machine:
          > > Core 2 Duo
          > > Visual Studio 9.0.30729.1
          > > pin-2.8-33586-msvc9-ia32_intel64-windows
          > >
          > > Thanks
          > >
          >
        • bitmolot
          In other words what you mean, the probes will have to be thread save, (regardless whether the synchronization primitives are from WinAPI or Pin), correct?
          Message 4 of 4 , May 18, 2010
          View Source
          • 0 Attachment
            In other words what you mean, the probes will have to be thread save, (regardless whether the synchronization primitives are from WinAPI or Pin), correct?

            Thanks a lot!

            --- In pinheads@yahoogroups.com, "tevi.devor" <tevi.devor@...> wrote:
            >
            > Re-reading your message - I see you are in probe-mode.
            > My answer pertained to Jit mode only.
            >
            > In probe-mode Pin is not aware of threads, so you should be able to create private pintool threads in probe-mode windows pintools using the native windows API. Be aware that any probes you insert will be executed by these private threads if they call the probed functions.
            >
            > --- In pinheads@yahoogroups.com, "tevi.devor" <tevi.devor@> wrote:
            > >
            > > In the latest pin (33586) kit look at the PIN_SpawnInternalThread API.
            > > Also look at MemTrace\membuffer_threadpool.cpp for example of how to use this API and related APIs to utilize and manage tool-internal threads.
            > > Also follow the "cgo tutorial slides are posted" link at http://www.pintool.org and look at the slides that describe membuffer_threadpool.
            > > Also look at other tools in the kit that use the PIN_SpawnInternalThread API.
            > >
            > > --- In pinheads@yahoogroups.com, "bitmolot" <bitmolot@> wrote:
            > > >
            > > > Hello, I'm testing a distributed application by employing two
            > > > simulators. One simulator submits a UDP message to the app, the other
            > > > bounces the message via the same app instance back to the original
            > > > simulator. This is one of the testing scenarios.
            > > > I'm using thread and communication wrappers from the ACE library. The
            > > > library is statically linked in.
            > > >
            > > > To simplify the deployment/testing process, I'd like to use Pin to instrument the app in probe mode. I should be able to send messages at predefined intervals. This would imply the usage of a separate timer thread within my PinTool (a separate process would defeat the purpose of Pin's usage).
            > > > In FAQ it states that I cannot create a private PinTool threads; guess
            > > > it can be rephrased as "cannot create a private thread that will not
            > > > cause problems"?
            > > >
            > > > So, is there a way (and what is it) or is it even possible to use a
            > > > thread/comm library without problems in probe mode? Any other
            > > > suggestions on how I can solve the problem?
            > > >
            > > > My testing machine:
            > > > Core 2 Duo
            > > > Visual Studio 9.0.30729.1
            > > > pin-2.8-33586-msvc9-ia32_intel64-windows
            > > >
            > > > Thanks
            > > >
            > >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.