3 Replies
      Latest reply on Jan 8, 2019 11:48 AM by dmaclach
      dmaclach Level 1 Level 1 (0 points)

        If I wanted a column of my stores table to be the name of the process, what would I put in my schema? For example

         

        <ktrace-interval-schema>

        ...

        ...

        ...

         

            <column>

              <mnemonic>process</mnemonic>

              <title>Process</title>

              <type>raw-string</type>

              <expression>is-there-some-value-i-can-put-here</expression>

            </column>

        </ktrace-interval-schema>

         

        It would be incredibly useful for those of us attempting custom instrument creation if the source to some of instruments "Instruments" were available somewhere to peruse... right now trying to figure out how to use CLIPS in a custom instrument is rather terrifying to say the least.

         

         

         

        Cheers,

        Dave

        • Re: process name in custom instrument
          cwoolf Apple Staff Apple Staff (40 points)

          Start by using <type>process</type>.  Then if you capture the thread in the start or end pattern, say into a variable called "?thread", you can use the expression:

           

          <expression>(process-from-thread ?thread)</expression>

           

          That extracts an object of the engineering type "process".  We're working on the documentation for functions like "(process-from-thread ...)".

            • Re: process name in custom instrument
              dmaclach Level 1 Level 1 (0 points)

              Thank you so much! Knew there was some secret incantation somewhere

               

                <ktrace-interval-schema>
                  <id>com-google-dyld-launch-executable-schema</id>
                  <title>dyld launch executable</title>
                  <start-pattern>
                    <class>31</class>
                    <subclass>7</subclass>
                    <code>1</code>
                    <function>1</function>
                    <thread>?thread</thread>
                  </start-pattern>
                  <end-pattern>
                    <class>31</class>
                    <subclass>7</subclass>
                    <code>1</code>
                    <function>2</function>
                  </end-pattern>
                  <start-column>
                    <mnemonic>start</mnemonic>
                    <title>Start</title>
                    <type>start-time</type>
                  </start-column>
                  <duration-column>
                    <mnemonic>duration</mnemonic>
                    <title>Duration</title>
                    <type>duration</type>
                  </duration-column>
                  <column>
                    <mnemonic>process</mnemonic>
                    <title>Process</title>
                    <type>process</type>
                    <expression>(process-from-thread ?thread)</expression>
                  </column>
                </ktrace-interval-schema>