What does the offset mean in BCC - ebpf

I've been using BCC to profile my code.
As part of it I'm looking at the offset we get when using the sym() function, which gets a function name from an address and a pid, and optionally displays the offset.
I got the following results when profiling with the profile.py tool :
count1e8 offset 54
main offset 100
__libc_start_main offset 231
[unknown]
- profile (7446)
9
I tweaked the output a little bit to read the offset in base 10 instead of 16.
I do not understand what the offset mean in this context, the doc reads as 'instruction offset from the beginning of the symbol', but I can't match the offsets from the output with any files (source, asm, elf).
How do I read count1e8 offset 54?
The goal would ultimately be to trace back this offset to either the ASM instruction or the source file line which originated this instruction.

Related

Write chords using MIDO to a file

I have a hard time writing chords in a MIDI file using MIDO, the MIDI library for Python.
I have a list of 100 chords with notes stored in the list. So each chord in the code below is [60, 63, 67] as in Cmin. The timing of each in seconds is stored in the chordTimes list.
I iterate in the list,
for i in range(1, len(chords)):
chordNotes = chordMidiNotes(chords[i], extraBass= False)[0]
chordSymbol = chordMidiNotes(chords[i], extraBass= False)[1]
for note_value in chordNotes: # result has chord notes
track.append(Message('note_on', note=note_value, velocity=100, time=0))
for note_value in chordNotes: # result has chord notes
track.append(Message('note_off', note=note_value, velocity=127, time=time_in_ticks(chordTimes[i], mo)))
mo.save("songWithChords.mid")
But then when I open the files, the chords start at the same time, however, the top note ends just before last chords, the one below ends before that, the one before the later stops again several beats before it, .... as you see in the image. I am using type 1 midi file.
The MIDO documentation says:
All messages must be tagged with delta time (in ticks). (A delta time is how long to wait before the next message.)
So the delta times of all note-off messages except the first one must be zero.

parse text file to find lines which contain a date after 05/05/2011

I could like to be able to list the line no.s in a file which contain a date, in the format dd,mm,yy, which is greater than 05/05/11
the file in question is prolog source code - the dates form part of a comment indicating when the modification after the comment was made
I'm using emacs, so thought an emacs solution would be the obvious way forward but willing to think more laterally if need be
a typical line of interest would be:
4.00 21/10/12 Modified to incorporate proportional match tolerances
I would like to report the file and line no. e.g.
filename line no.
my_source_1.pl 37
or alternatively, just being able to step through the file using Regexp I-search highlighting each dd/mm/yy that is greater than 05/05/2011 would be very useful

How to suppress all messages in knitr/ Rmarkdown?

I have used dplyr for some of the analyses and for a particular code it takes about 30 seconds to complete the operation. In the resulting HTML I get a very long output of something like this (reproducing last few lines):
|================================================ |100% ~0 s remaining
|================================================ |100% ~0 s remaining
Completed after 35 s
I don't want this to show in the output. How can I suppress this? Is there anythink in the global chunk options of knitr that could stop these messages
I think you want the chunk option results='hide' for that particular code chunk only.
```{r results='hide'}
# do your dplyr computation here
```
or do message='hide' or if you have a warning you do waring='hide'.
Depends on what is showing but if you look up chunk options in google you can find which one will hide what you are wanting to hide.

What's the difference between SYSOUT and SYSPRINT of a job?

While coding a JCL, we give SYSOUT and SYSPRINT DDs. Which type of output goes to SYSOUT and what else to SYSPRINT?
SYSOUT is always allocated and gets among other things all the output from the System level process (including any messages about the JCL itself, performance stats, error messages etc.)
SYSPRINT is just another DD which, by convention, is used by utility programs for thier output.
sysout : To print the output of the program in spool,it is a system defined program.
sysprint : To print messages of the program execution, and ii contains compile source listing and line no, offset no.
Historically, IBM utility programs used SYSOUT for status messages, and used SYSPRINT for the utility program reports.
In COBOL programs, the output of DISPLAY statements goes to SYSOUT.
JCL related messages from a JES system are written to JESMSG. (Not sure of the spelling. I'm at home now, not at work.)
SYSOUT system defined dd name used for file status codes and system abend codes information and output of the display statement can be viewd
and sysout parameter used to direct the output device and genarete during execution of the job to an output device
SYSPRINT contains the compiled source listing and for each line in the soucrce listing a line number and offset no can be genarated

AudioFileReadBytes error

I read a file .caf with my program.
I use AudioFileReadBytes, but its OSStatus that return is -39, what is this??
thanks
Error number -39 (negative thirty-nine) is eofErr, a Mac OS Carbon error, which comes from the original Mac toolbox from the 1984. It's defined in MacErrors.r. That means it reached the end of the file, and there are no more bytes to read. You should note the number of bytes returned and complete whatever processing you're doing of the file at that point.
If you want to avoid the error, you can read the file length and number of samples from the various API calls, and calculate how many bytes to read, and never go past the end of the file.