[Openmcl-devel] oprofile and libelf

Osei Poku osei.poku at gmail.com
Mon Apr 6 22:24:16 PDT 2009


Hi,

Trying to follow: http://ccl.clozure.com/manual/chapter11.1.html for  
enabling profiling in ccl using oprofile...

Calling (ccl::write-elf-symbols-to-file "/home/opoku/elf-symbols")  
fails though with the error...

"Error: Can't initialize libelf object for "/home/opoku/elf-symbols":  
Request error: invalid ELF_C_* argument"
 > While executing: CCL::CREATE-ELF-OBJECT, in process listener(1).
 > Type :POP to abort, :R for a list of available restarts.
 > Type :? for other options.
1 > :b
  (2AAAAACBBA58) : 0 (CREATE-ELF-OBJECT "/home/opoku/elf-symbols") 485
  (2AAAAACBBA88) : 1 (WRITE-ELF-SYMBOLS-TO-FILE "/home/opoku/elf- 
symbols") 53
  (2AAAAACBBAC0) : 2 (CALL-CHECK-REGS CCL::WRITE-ELF-SYMBOLS-TO-FILE "/ 
home/opoku/elf-symbols") 229
  (2AAAAACBBAF8) : 3 (TOPLEVEL-EVAL (CCL::WRITE-ELF-SYMBOLS-TO-FILE "/ 
home/opoku/elf-symbols") NIL) 733
  (2AAAAACBBB98) : 4 (READ-LOOP :INPUT-STREAM #<SYNONYM-STREAM to  
*TERMINAL-IO* #x300040EF424D> :OUTPUT-STREAM #<SYNONYM-STREAM to  
*TERMINAL-IO* #x300040EF40ED> :BREAK-LEVEL 0 :PROMPT-FUNCTION  
#<Compiled-function (:INTERNAL CCL::READ-LOOP) (Non-Global)   
#x3000405448FF>) 2053
  (2AAAAACBBDD8) : 5 (TOPLEVEL-LOOP) 109
  (2AAAAACBBE08) : 6 (FUNCALL #'#<(:INTERNAL (TOPLEVEL-FUNCTION  
(CCL::LISP-DEVELOPMENT-SYSTEM T)))>) 101
  (2AAAAACBBE20) : 7 (FUNCALL #'#<(:INTERNAL CCL::MAKE-MCL-LISTENER- 
PROCESS)>) 645
  (2AAAAACBBEB8) : 8 (RUN-PROCESS-INITIAL-FORM #<TTY-LISTENER  
listener(1) [Active] #x300040EF2F9D> (#<COMPILED-LEXICAL-CLOSURE #  
#x300040EF2CAF>)) 717
  (2AAAAACBBF48) : 9 (FUNCALL #'#<(:INTERNAL CCL::%PROCESS-PRESET- 
INTERNAL)> #<TTY-LISTENER listener(1) [Active] #x300040EF2F9D>  
(#<COMPILED-LEXICAL-CLOSURE # #x300040EF2CAF>)) 389
  (2AAAAACBBF98) : 10 (FUNCALL #'#<(:INTERNAL CCL::THREAD-MAKE-STARTUP- 
FUNCTION)>) 301

I don't see why though, ccl:library:elf.lisp... this is create-elf- 
object and ELF_C_WRITE is defined in the the libelf.h header file as a  
valid command.  My system is using version 0.8.6. and ccl version  
Version 1.3-RC1-r11885M.

(defun create-elf-object (pathname)
   (let* ((namestring (native-translated-namestring pathname))
          (fd (ccl::fd-open namestring
                            (logior #$O_RDWR #$O_CREAT #$O_TRUNC)
                            #o755)))
     (if (< fd 0)
       (signal-file-error fd pathname)
       (progn
         (check-libelf-version)
         (let* ((ptr (#_elf_begin fd #$ELF_C_WRITE +null-ptr+)))
           (if (%null-ptr-p ptr)
             (error "Can't initialize libelf object for ~s: ~a"
                    pathname (libelf-error-string))
             (make-elf-object :libelf-pointer (assert-pointer-type  
ptr :<E>lf)
                              :fd fd
                              :pathname pathname)))))))


Thanks,

Osei



More information about the Openmcl-devel mailing list