Unpacking, hld

unpack_hld.pl

The script unpacks the hld file (taking into account big/little endian byte ordering) and stores the output in the array. User can use analyzeData() function to analyze the data or add his own functions.

  • Name: unpack_hld.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

Usage:

   Command line:  unpack_hld.pl
   [-h|--help]                     : Show this help.
    -f|--file <file>               : Path to hld file.
   [-v|--verb]                     : Dump hld file content.
   [-d|--debug]                    : More debugging output.

Etrax soft

Command server

The command server listens TCP socket, reads the command, executes this command on the Etrax and returns the output of the command.

  • Name: command_server
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: etrax_apps_r20

Usage: /home/hadaq/bin/command_server 
       [-p port]    : port number for connection
       [-v]         : verbosity

Command server for /dev/ttyS1 serial interface

The command server listens TCP socket, reads the command and writes this command to /dev/ttyS1 serial interface. Then the server reads the answer from /dev/ttyS1 and returns it via TCP socket.

  • Name: devip
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: etrax_apps_r20

Usage: /home/hadaq/bin/devip 
       [-p port]               : Port number for connection.
       [-v]                    : More verbose.                                      
       [-d device]             : Serial interface (default: /dev/ttyS1).            
       [-t sec]                : Timeout in seconds (default: 5 sec).

TRB related tools

ping.pl - Check connection to TRBs.

  • Name: ping.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

ping.pl

   This script checks connection to TRB boards
   using ping.

Usage:

   Command line:  ping.pl
   [-h|--help]               : Print this help.
   [-b|--base name]          : TRB base name.
   [-f|--first number]       : Serial number of first TRB.
   [-l|--last  number]       : Serial number of last TRB.

Examples:

   Check connection to all TRBs between etraxp021 and etraxp106:
      ping.pl -b etraxp -f 21 -l 106

flash_ftp.pl - Flash kernel via FTP for TRBs with Etrax FS in parallel

  • Name: flash_ftp.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

flash_ftp.pl

   This script reads the kernel compile time on Etrax boards
   via telnet using expect. The script also flashs new kernel
   via FTP using expect. Directory with fimage and a list of
   Etrax boards are given at the beginning of the script.

Usage:

   Command line:  flash_ftp.pl
   [-h|--help]                     : Show this help.
   [-t|--time]                     : Show kernel compile time.
   [-f|--flash]                    : Flash new kernel.
   [-r|--reboot]                   : Reboot boards.
   [-b|--base <name>]              : Etrax base name (default: etraxp).
   [-n|--num <firstNr-lastNr>]     : Range of Etrax numbers.

Examples:

   Show kernel compile time of all the boards in the range etraxp041-etraxp061:
      flash_ftp.pl -t -b etraxp -n 41-61

command_client.pl - Connects to command_server and executes a command on the TRB.

  • Name: command_client.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

command_client.pl

   This script executes the command via Command_Server running
   on etrax boards.

Usage:

   Command line:  command_client.pl
   [-h|--help]             : Show this help.
   [-e|--etrax <name>]     : Etrax board name.
   [-c|--command <'cmd'>]  : Command to execute.
   [-p|--port <port>]      : Port to connect to a server (default: 4712).
   [-i|--inter]            : Interactive execution of the commands.

Examples:

   Execute command 'sleep 10' on etraxp086:
      command_client.pl -c 'sleep 10' -e etraxp086

   Execute commands on etraxp086 interactively:
      command_client.pl -i -e etraxp086

command_mclient.pl - Connects to many command servers and executes a command in parallel.

  • Name: command_mclient.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

This script executes the command on many TRBs via Command Servers running on etrax boards.

Usage:

   Command line:  command_mclient.pl
   [-h|--help]             : Show this help.
   [-e|--etrax <name>]     : Etrax board name.
   [-c|--command <'cmd'>]  : Command to execute.
   [-p|--port <port>]      : Port to connect to a server (default: 4712).
   [-b|--base name]        : TRB base name.
   [-f|--first number]     : Serial number of first TRB.
   [-l|--last  number]     : Serial number of last TRB.

Examples:

   Log the message on all Etrax boards from etraxp081 to etraxp120:
      ./command_mclient.pl -b etraxp -f 81 -l 120 -c 'logger -p local1.info -t DAQ My logger test'

test_oepb.pl - Script to test OEP-Boards.

  • Name: test_oepb.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

test_oepb.pl

   This script tests OEPBs.

Usage:

   Command line:  test_oepb.pl
   [-h|--help]         : Show this help.
    -e|--etrax name    : Start trb commands on Etrax.
   [-s|--step all|     : Test everything. This is default option.
             fpga|     : Boot from flash #0/1, program flash #0/1.
              rdo]     : Test readout.
   [-m|--mult number]  : Program flashes and boot this number of times.
   [-p|--protect]      : Do write protection of flash #0.

Examples:

   Test everything on OEP connected to etrax161:
      test_oepb.pl -e etrax161

   Test only flash programming and booting 10 times in a row:
      test_oepb.pl -e etrax161 -s fpga -m 10

   Test only readout:
      test_oepb.pl -e etrax161 -s rdo

   Do write protection of flash #0:
      test_oepb.pl -e etrax161 -p

getUniqueId.pl - Extract temp sensor numbers and construct unique Id

  • Name: getUniqueId.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

getUniqueId.pl

   This script logs on to the board via expect and gets
   the temperature sensor numbers using 'tempsens' program.
   Then it converts the obtained numbers to a unique Id number.
   Script uses threads for the fast access to many boards.

Usage:

   Command line:  getUniqueId.pl
   [-h|--help]             : Show this help.
    -e|--etrax <name>      : Log on to this etrax board and read
                             temperature sensor numbers.
   [-l|--long]             : Long output format.

Examples:

   Get unique Id of etraxp023 and print in long format:
      getUniqueId.pl -e etraxp023 -l

   Get unique Ids of all boards between etraxp020 and etraxp110:
      getUniqueId.pl -e etraxp020 -e etraxp110

widthGenerator.pl - Generate signals with variable width for CTS

  • Name: widthGenerator.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

    This script generates signals with extended width for the CTS
    (Central Trigger System) accordning to the following format (in Hex):
    <8-bit signal> <8-bit reminder> <2-bit integer result of division>

    Signal is extended by the value in the range 0-31.
    For example, signal 00010010 and value 2 result in extended signal
    01111110 with reminder 00000000 and 00 or in hex 7e 00 0.
    For the signal 00010010 and value 12 we get 11111110 with reminder
    00000001 and 01 or in hex fe 01 1.

    The mapping between memory addresses and signals is given in %addr2sig hash.

Usage:

   Command line: widthGenerator.pl
   Without args      : Generate hex output for the extended signals.
   [-a|--all]        : Show additional numbers in bin and hex formats.

Examples:

   For the debugging run: widthGenerator.pl -a
   It will generate an extended output like:
      #sig1    val sig2     rem      div sig2 rem div
      #bin     dec bin      bin      dec hex  hex hex
      00000000 00  00000000 00000000 0   00   00  0
      00000000 01  00000000 00000000 0   00   00  0
      .............................................
      00000001 16  11111111 00000001 1   ff   01  1
      00000001 17  11111111 00000011 1   ff   03  1
      00000001 18  11111111 00000111 1   ff   07  1
      .............................................

   where
      sig1  : Initial signal in binary format.
      val   : Value for signal extension in decimal format.
      sig2  : Extended signal in binary format.
      rem   : Remainder after devision by 8 in binary format.
      div   : Integer number of devisions by 8 in decimal format.
      sig2  : Extended signal in hex format.
      rem   : Remainder after devision by 8 in hex format.
      div   : Integer number of devisions by 8 in hex format.

      The final extended signal output: sig2(hex)+rem(hex)+div(hex)

widthGenerator2.pl - Generate signals with variable width for CTS

  • Name: widthGenerator2.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

widthGenerator2.pl

    This script generates signals with extended width for the CTS
    (Central Trigger System) accordning to the following format:
    
    Prolongation   Signal         Result
    31    -    0   7 -  0   ->    35 - 0
    000......000   00..00         00..00000000
    000......000   00..01         00..00000001

    000......000   10..00         00..10000000
    000......000   11..00         00..00000000 <---

    000......001   00..01         00..00000011
    000......011   00..01         00..00001111

    Only Signlas from 0x0 to 0x8 produce the result.
    Signals from 0x9 to 0xf result in zeros as indicated by arrow.

    The result is printed in hex.

start_daq_trb.pl - Start readout on TRB and Event Building

  • Name: start_daq_trb.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

   This script logins to TRBs, programs FPGAs, performs necessary
   settings and starts readout and event building (on lxhadesdaq).
   If you want to change a sequence in which the TRBs are programmed
   you should change a hash %daq_startup in a subroutine getDAQStartup().
   If you want to change a way how the TRBs are programmed you should
   do changes in a subroutine writeTRBScript().

Usage:

   Command line:  start_daq_trb.pl
   [-h|--help]          - Show this help.
   [-r|--readout]       - Start readout on TRBs.
   [-e|--eb]            - Start event building.
   -s|--system name     - System to be started (as well as an extension of
                          shared memory name).
   [-n|--null]          - Write to /dev/null.
   [-d|--dir name]      - Directory name for EB output (must be one dir name without '/').
   [-x|--ext prefix]    - Output hdl file prefix (te,md,to,st...).
   [-v|--verbose]       - More verbose.

   You must give a system name together with -r or -e arguments.

Requirements:

   Perl module Expect.pm is required.

daq_status.pl - Read status information from TRBs

  • Name: daq_status.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

This script logins to TRB(s) and extracts the status of the board by reading FPGA registers. The following addresses are supported: 1,2,4,5,6,7,8.

  • Examples:
    • Get status for the etrax032, address 5: daq_status.pl -e etrax032 -a 5
    • Get status for all TRBs, address 5: daq_status.pl -a 5
  • Usage:
    • Command line: daq_status.pl [-h|--help]
    • [-e|--etrax etrax_name] - name of the etrax (etrax032)
    • -a|--address address - address to be read
  • Requirements:
    • Perl module Expect.pm is required.

ctrl_daq.pl - Write a value to a register on a TRB

  • Name: ctrl_daq.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

This script logins to a specified TRB and writes to a specified register a specified value.

  • Usage:
    • Command line: ctrl_daq.pl
    • -e|--etrax : Etrax board.
    • -a|--address : Register address.
    • -v|--value : Value to be written.
    • [-h|--help] : Show this help.
  • Eample:
    • Write on board etrax031 to an address 'e' a value 10101: ctrl_daq.pl -e etrax031 -a e -v 10101
  • Requirements:
    • Perl module Expect.pm is required.

DAQ monitor

CTS Monitor

  • Name: mon_cts.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: trbsoft/daq/evtbuild

This script reads registers each second from CTS-AddOn and displays them. The configuration hash with all the register addresses is at the beginning of the script. The script works in two modes: default access via TRB-Net and another optional access via command server.

  • Usage:
    • Command line: mon_cts.pl

Hub Monitor

  • Name: mon_hub.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: trbsoft/daq/evtbuild

mon_hub.pl

   This script monitors busy time of Hubs as well as
   missing boards.

Usage:

   Command line:  mon_hub.pl
   [-h|--help]           : Show this help.
   [-o|--board <time>]   : Check time (seconds) for monitoring boards (default: 5 sec)
   [-b|--busy <time>]    : Check time (seconds) for monitoring busy times (default: 1 sec)

Examples:

   Start monitoring with check times of 10 sec and 0.5 sec for boards and hub busy time:
   mon_hub.pl --board 10 --busy 0.5

Start Monitor

  • Name: command_display_start.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

This script reads registers each second from CTS-AddOn and displays them. FPGA design on CTS board does not contain interface between FPGA and Etrax any longer because of the limited resources in the FPGA. Therefore one can access registers only via TRB-Net.

Usage:

   Command line:  command_display_start.pl
   [-h|--help]                 : Show this help.
   [-c|--cmd <trbcmd|cmdserv>] : Method to read register values (default: trbcmd).
   [-e|--etrax <name>]         : Etrax board name.
   [-p|--port  <port>]         : Port of command_server.
   [-t|--type  <dec|abs>]      : Print values of registers in dec(%) or absolute (default: dec).
   [-f|--fpga]                 : Program FPGA before reading registers.
   [-a|--addr <address>]       : Address of the board (default: 0x0099).
   [-v|--verb]                 : More verbouse.

Example:
   Start monitor using TRB-Net:  command_display_start.pl

Veto Monitor

  • Name: command_display_veto.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

This script reads registers each second from CTS-AddOn and displays them. FPGA design on CTS board does not contain interface between FPGA and Etrax any longer because of the limited resources in the FPGA. Therefore one can access registers only via TRB-Net.

Usage:

   Command line:  command_display_veto.pl
   [-h|--help]                 : Show this help.
   [-c|--cmd <trbcmd|cmdserv>] : Method to read register values (default: trbcmd).
   [-e|--etrax <name>]         : Etrax board name.
   [-p|--port  <port>]         : Port of command_server.
   [-t|--type  <dec|abs>]      : Print values of registers in dec(%) or absolute (default: dec).
   [-f|--fpga]                 : Program FPGA before reading registers.
   [-a|--addr <address>]       : Address of the board (default: 0x0099).
   [-v|--verb]                 : More verbouse.

Example:
   Start monitor using TRB-Net:  command_display_veto.pl

Log parser

  • Name: colorizelog.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

This script parses, filters and colorizes the log file.

Usage:

   Command line:  colorizelog.pl
   [-h|--help]              : Show this help.
   [-o|--or <name>]         : Accept log message only if at least one of the names is present.
   [-a|--and <name>]        : Accept log message only if all the names are present.
   [-e|--exclude <name>]    : Exclude log message if one of the names is present.

Examples:

   Filter only log messages containing "NETMEM" or "EVTBLD"
   and exclude log messages containing "exited":
      colorizelog.pl --or NETMEM --or EVTBLD --exclude exited

DAQ startup

Read/write TDC resolution mode from/to register

  • Bash script: lxhadesdaq:/var/diskless/etrax_fs/scripts/set_modrc.sh
  • Script overwrites only the bits according to the MASK (the Mask masks bits which should not be changed).
  • Example: write 0x11 to register 0x21 on board 0x8000: set_modrc.sh 0x11 0x8000 0x21

#!/home/hadaq/bash

# Get params
MODE=${1:-202}
ADDR=${2:-202}
REG=${3:-202}

MASK=0xffff00ff
SHIFT=8

# For debugging
#trbcmd w 0x8000 0x21 0x33441155

# Read register
VAL=`trbcmd r $ADDR $REG | awk '{print $2}'`

# Apply MASK
REST=$(($VAL & $MASK))

# Shift MODE by two hex (8 bits)
MODE=$(($MODE << $SHIFT))

# Calc final value
VAL=$(($REST | $MODE))

# Write the value to the register
trbcmd w $ADDR $REG $VAL

daqop

General description

The daqop tool is used as a simplified, human-readable access to TRBNET. It operates outside the optical network on a common PC. The PC, however, needs an ethernet connection to a TRB. It calls trbcmd on ETRAX, parses the output and displays it either in raw or human-readable form.

  • Name: daqop
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: trbsoft/daqop

Usage:

   Command line:  daqop
   help                        : List all commands and syntax info.
   trbcmd <args>               : Executes a remote trbcmd call, as specified in <args>, e.g. daqop trbcmd r 0x0
   <...>                       : all other commands can be found using 'help'.
   []                          : No command - starts the interactive mode (not used anymore)

   Examples:

            daqop read ids
            daqop read oep voltages
            daqop get code violations
   

Errorhandling

The daqop tool forwards all Errors and Warnings from trbcmd. If a Warning occurs, it will continue operating and the warning will be attached to the output at the end. An Error breaks daqop immediately. All trbcmd errors are prompted as Errorcode 01 - internal TRBNET error. In addition to that, there are daqop-internal errorcodes enumerated from 02-06.

hubmonitor.pl

Use this script in a terminal to monitor the hub status and busy times. If it shows abnormal behavior - enlarge the screen wink The script does not respond to user inputs - kill it with ctrl-c.

globalmonitor.pl

Shows (a) system - busies, (b) if a board that should be present in TrbNet is not found, and (c) error status (a + denotes that more similar errors on that particular subsystem were found). If it shows abnormal behavior - enlarge the screen wink The script does not respond to user inputs - kill it with ctrl-c.

DAQ to Oracle

  • First we have to fill two Oracle tables with info on all boards and on all subEvtIds.
  • To find all boards (active and inactive) we run:
    • daq2stdout.pl -p db -o subevtid > subevtids.txt
    • daq2stdout.pl -p db -o board > boards.txt
  • To fill these files to Oracle we run:
    • board2ora.pl -t subevtid -f subevtids.txt
    • board2ora.pl -t board -f boards.txt

daq2stdout.pl - print info on the boards to STDOUT

  • Name: daq2stdout.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: trbsoft/daq/oracle/

daq2stdout.pl

   This script prints information related to the boards to STDOUT.

Usage:

   Command line:  daq2stdout.pl
   [-h|--help]                   : Show this help.
   [-p|--print active|db]        : Print active boards or
                                   all boards from Data Bases.
   [-o|--output board|subevtid]  : Print boards or subevtids.
   [-v|--verb]                   : More verbous.

Examples:

   Print active boards:
      daq2stdout.pl -p active

   Print subevtids from Data Base files:
      daq2stdout.pl -p db -o subevtid

board2ora.pl - insert info from file to Oracle

  • Name: board2ora.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: trbsoft/daq/oracle/

board2ora.pl

   This script stores information related to the boards in Oracle data base.

Usage:

   Command line:  board2ora.pl
   [-h|--help]               : Print this help.
   [-v|--verb]               : More verbouse.
   [-t|--table <board|       : Insert an info to 'board' table
               subevtid>]      or to 'subevtid' table.
   [-f|--file <path/file>]   : Path to a file with the info
                               for insertion to Oracle DB.

Examples:

   Insert info on subEvtIds from file subevtids.txt to Oracle:
       board2ora.pl -t subevtid -f subevtids.txt

   Insert info on boards from file boards.txt to Oracle:
       board2ora.pl -t board -f boards.txt

daq2ora_client.pl - daemon to insert board info to Oracle

  • Name: daq2ora_client.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: trbsoft/daq/oracle/

This script runs in the background as a daemon, reads new files in the directory and stores the info on the boards to the Oracle data base. The time stamp of the file must be later than the time stamp of the last commit to the Oracle.

daq2ora_client.pl

   This script stores information related to the boards in Oracle data base.

Usage:

   Command line:  daq2ora_client.pl
   [-h|--help]               : Print this help.
   [-b|--base name]          : A base of file name to read (default: daq2ora).
   [-i|--indir name]         : Directory with input files (default: /home/hadaq/oper/daq2ora).
   [-d|--daemon]             : Run as a daemon.
   [-o|--oracle]             : Do insert to Oracle data base.
   [-p|--sport port]         : Port for status server.
   [-v|--verb]               : More verbous.
   [-f|--file file]          : Given file for insertion to Oracle.

Exaples:

   Insert info from files in $opt_dir to Oracle and be verbous:
      daq2ora_client.pl -o -v

Magnet data to Oracle

Each midnight Labview writes the Magnet data to hades28:/home/magnet/Hades_Magnet_Labview/Log/log1/. This data is copied each night to the standard GSI PC:
  • The cron job on hades28 executes /home/magnet/cron/cp_magnet_data.pl which copies the second last file at 1:00 at night from hades28 to lxhadesdaq:/home/hadaq/magnet/data/
  • The cron job on lxhadesdaq executes /home/hadaq/cron/scripts/cp_magnet_data.pl which copies the last file at 2:00 at night from lxhadesdaq to lxi001:/misc/hadaq/magnet/data/

The copying procedure must be done via lxhadesdaq because hades28 is only in HADES VLAN. Passwordless access is required from magnet@hades28 to hadaq@lxhadesdaq and from hadaq@lxhadesdaq to hadaq@lxi001.

The corresponding scripts are also in CVS:
  • Name: cp_magnet_data1.pl (Magnet data from hades28 to lxhadesdaq)
  • Name: cp_magnet_data2.pl (Magnet data from lxhadesdaq to lxi001)
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

Event Builders

daq_disks - Server for data storage on multiple disks

Event Builder processes running on one machine should be able to write to different disks (and several EBs should never write on the same disk). daq_disks server provides a disk number for daq_evtbuild via shared memory (daq_evtbuild must be executed with --multidisk option). daq_disks finds itself all shared memory segments opened by EBs.

  • Name: disks
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: evtbuild

Usage: ./daq_disks
       [-h|--help]            : Print this help.
       [-s|--sleep <time>]    : Sleep time.
       [-D|--debug]           : Debug output.

cleanup.pl - Cleanup disks of EB

Script simply removes oldest files on the EB's disks.

  • Name: disks
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: evtbuild

cleanup_evtbuild.pl - Cleanup shared memory segments

The script finds and removes shared memory segments.

  • Name: disks
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: evtbuild

ipcrm.pl - Cleanup semaphores

This script finds and closes still open semaphores.

  • Name: disks
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: evtbuild

eb_logmonitor.pl - Monitoring of EB's log files

This script reads log files of parallel Event Building processes. The script starts a new thread for each log file. After processing the log files the script writes out the formatted output with time stamp and other information on all EBs to a separate log file.

  • Name: eb_logmonitor.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: trbsoft/daq/evtbuild

Usage:

   Command line:  eb_logmonitor.pl
   [-h|--help]             : Show this help.
   [-s|--sleep <sec>]      : Sleep time in sec (default: 5).
   [-t|--thsleep <sec>]    : Sleep time of threads in sec (default: 5).
   [-v|--verb]             : More verbouse.
   [-d|--dir <dir>]        : Directory with log files (default: /home/hadaq/oper).
   [-b|--daemon]           : Execute as a daemon.

Displaying and colorizing EB log

To read and display the output of eb_logmonitor.pl one should simply start /home/hadaq/Desktop/DAQ/EBLog_Watch.desktop on lxhadesdaq.

The following is the sequence of commands which will be then executed:

  • /home/hadaq/Desktop/DAQ/EBLog_Watch.desktop
    • xterm -geometry 132x8-0-200 -bg darkblue -fg white -cr white -ms white -T "EB Log Watch" /home/hadaq/bin/eblog_watch
  • /home/hadaq/bin/eblog_watch
    • tail -n 300 --follow=name /home/hadaq/oper/eb_all_log.txt | /home/hadaq/bin/colorizelog_eb.pl

The script colorizelog_eb.pl is colorizing the output.

  • Name: colorizelog_eb.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

data2tape.pl - Archive data to tape

Archive EB's data to tape if the data were not archived via RFIO during data taking.

  • Name: date2tape.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: evtbuild/disks

Usage:

   Command line:  date2tape.pl
   [-h|--help]               : Show this help.
   [-s|--start <date_time>]  : Beginning of time interval.
   [-t|--end <date_time>]    : End of time interval.
   [-p|--prefix <prefix>]    : Archive only these prefixes.
   [-a|--arch <archive>]     : Archiving is done only with this option enabled.

Examples:

   Archive all hld files with prefixes 'st' and 'be' from sept 4th, 2010 to the archive hadessep10raw:
   date2tape.pl -p be -p st -s 2010-09-04_00:00:00 -e 2010-09-04_23:59:59 -a hadessep10raw

archived_data.pl - Compare archived data to the hld files on EB disks

  • Name: archived_data.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: evtbuild/disks

This script prints several hld file lists:
1. The list of files which were archived already and can be deleted.
2. The list of files which were not archived yet.

Usage:

   Command line:  archived_data.pl
   [-h|--help]                 : Show this help.
   [-s|--start <date_time>]    : Beginning of time interval.
   [-t|--end <date_time>]      : End of time interval.
   [-p|--prefix <prefix>]      : Archive only these prefixes.
   [-a|--arch]                 : Name of archive.
   [-o|--out <tape|disk|all>]  : Print output format:
                                    tape : files on tape|cache
                                    disk : files on EB disks only
                                    all  : all files
   [-r|--rm <file>]            : File path with hld files to be removed
                                 from the disks of EB.

Examples:

   Check all hld files on tape from archive hadesoct10raw with prefix 'be':
   archived_data.pl -a hadesoct10raw -p be -o tape

check_hld_list.pl - Find hld files on tape, EBs disks and local disks

  • Name: check_hld_list.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

  • How to find and archive data from local lxhadesdaq disks:
    • Find data on local disks on lxhadesdaq: ./bin/check_hld_list.pl -c local -f /home/hadaq/local_mdc_hhld_kgoebel.txt > txt_local.txt
    • Filter out data only on disks: cat txt_local.txt | grep lxhadesdaq | awk '{print $3}' > local_mdc_hld.txt
    • Start on lxhadesdaq: ./bin/data2tape.pl -f ./local_mdc_hld.txt -a hadesuser -d kgoebel/hld
  • How to find and archive data on remove EB server disks:
    • Find data on remote disks (exec on lxhadesdaq): ./bin/check_hld_list.pl -f /home/hadaq/tmp/kgoebel_filelist.txt > txt_remote.txt
    • Filter out data only on disks: cat txt_remote.txt | grep lxhadeb02 | awk '{print $3}' > lxhadeb02_hld2tape.txt
    • Copy lxhadeb02_hld2tape.txt to lxhadeb02.gsi.de:/tmp/
    • Start on lxhadeb02: ./bin/data2tape.pl -f /tmp/lxhadeb02_hld2tape.txt -a hadesuser -d kgoebel/hld

check_hld_list.pl

   This script takes hld file list as an argument and checks
   if the hld files from the list were archived on tape and also
   finds the files on the disks of the EB servers.

   You can grep and sort the output of this script and provide it as
   input to data2tape.pl to archive the data: ./bin/data2tape.pl -f /tmp/lxhadeb02_hld2tape.txt -a hadesuser -d kgoebel/hld

Usage:

   Command line:  check_hld_list.pl
   [-h|--help]                 - Show this help.
    -f|--file <filename>       - Path to a file with a list of hld file names.
   [-c|--comp <remote|local>]  - Look for files locally or on remote EB servers.

Examples:

   Show the status of the hld files in the list /home/hadaq/tmp/kgoebel_filelist.txt:
      check_hld_list.pl -f /home/hadaq/tmp/kgoebel_filelist.txt

Requirements:

   You must have passwordless login to the EB servers via ssh. You can
   use SSH_KEYGEN to generate a key-pair.
   Date/Manip.pm module is needed: apt-get install libdate-manip-perl

Scan ports of Event Buidler

  • Name: scan_active_ports.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

   This script reads the ports from a file /tmp/eb1_192.168.100.11.txt
   generated by start_eb_gbe.pl script. And then it scans all the ports
   and defines which ports got no data.

   If you reconfigure DAQ and change data sources, do not forget
   to restart start_eb_gbe.pl to generate new files with active ports.

   Make sure that no other EB processes are listening to the ports
   when you run this script.

Usage:

   Command line:  startup.pl
   [-h|--help]             : Show this help.
   [-e|--eb <EB_number>]   : Scan ports for this EB number.

EPICS

start_ioc.pl - Start IOC on TRBs

  • Name: start_ioc.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

start_ioc.pl

   This script logins to etrax boards and starts IOC.

Usage:

   Command line:  start_ioc.pl
   [-h|--help]        : Show this help.
   [-e|--etrax name]  : Name of etrax board.
   [-s|--screen]      : Start IOC in screen.

   By default if no arguments are specified the IOC is started
   on all etrax boards given in %ioc_config hash in getIOCConfig().

Examples:

   Start IOC on all etrax boards:
   start_ioc.pl

   Start IOC on etrax031 in screen:
   start_ioc.pl -e etrax031 -s

Other

cp_hld.pl - Copy hld files from data disks of EBs to local host

  • Name: cp_hld.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

This script uses netcat functionality to copy hld files
   from lxhadeb01/2/3/4 to local machine.                 

Usage:
      
   Command line:  cp_hld.pl 
   [-h|--help]               - Show this help.
   [-e|--eb <pcname>]        - lxhadeb01/2/3/4 (default: lxhadeb01).
   [-n|--nr <nrOfFiles>]     - Number of hld files to be copied (default: 1).
   [-x|--prefix <prefix>]    - Prefix of hld file (default: be).             
   [-p|--port <portNr>]      - Port for netcat (if the default 12345 is not working). 
   [-c|--cmd <command>]      - Command: show_file | show_run | copy
                               show_file: show list of recent hld files
                               show_run:  show list of recent Run IDs
                               copy:      copy a nrOfFiles
   [-r|--run <runId>]        - Run ID
   [-o|--outdir <dirname>]   - Absolute local directory name (default: .)

Examples:

   Show 5 recent hld files on lxhadeb01 with any prefix:
   cp_hld.pl -e lxhadeb01 -n 5 -c show_file -x ..

   Show 10 recent hld files on lxhadeb01 with prefix 'st':
   cp_hld.pl -e lxhadeb01 -n 10 -c show_file -x st

   Show 10 recent Run IDs on lxhadeb01 from the files with prefix 'st':
   cp_hld.pl -e lxhadeb01 -n 10 -c show_run -x st

   Copy 3 recent hld files from lxhadeb01 with prefix 'st':
   cp_hld.pl -e lxhadeb01 -n 3 -c copy -x st

   Copy 1 hld file from lxhadeb01 with Run ID 10295144822:
   cp_hld.pl -e lxhadeb01 -n 1 -c copy -r 10295144822 -x ..

Requirements:

   You must have passwordless login to remote machine via ssh. You can
   use SSH_KEYGEN to generate a key-pair.

cpnetcat.pl - Copy dirs/files from remote host to local host and vice versa

  • Name: cpnetcat.pl
  • CVS Root: /misc/hadesprojects/daq/cvsroot/
  • CVS Repository: tools

   This script uses netcat functionality to copy directories/files
   from a local host to a remote host or vice versa.

Usage:
  
   Command line:  cpnetcat.pl 
   [-h|--help]               - Show this help.
    -i|--in path             - Input path.
    -f|--file "file1 file2"  - List of files in input path to be copied.
    -o|--out path            - Output path. 
   [-p|--port 12345]         - Port for netcat (if the default is not working). 
    
   You can provide many input paths.

Examples:

   Copy two files from a local host to a remote host:
   cpnetcat.pl -i /home/user/ -f "file1 file2" -o remotehost.gsi.de:/u/user/

   Copy a content of directory from a remote host to a local host (default -f is '*'):
   cpnetcat.pl -i remotehost.gsi.de:/u/user/dir -o /home/user/

   Copy a directory from a local host to a remote host (here 'dir' is a directory name
   in the input path '/home/user/'):
   cpnetcat.pl -i /home/user/ -f dir -o remotehost.gsi.de:/u/user/

Requirements:

   You must have passwordless login to remote machine via ssh. You can
   use SSH_KEYGEN to generate a key-pair.

VMPlayer on Ubuntu

  • gksudo bash ./VMware-Player-2.5.1-126130.i386.bundle
  • copy vmware from other machine
  • sudo mv /usr/lib/vmware/modules/binary /usr/lib/vmware/modules/binary.old
  • sudo apt-get install linux-headers-2.6.28-13-generic
  • sudo vmware-modconfig --console --install-all
  • vncserver :30
  • DISPLAY=:30 /usr/bin/vmplayer "/home/marek/vmware/WindowsXPProfessional/Windows XP Professional.vmx"
  • Login to Windows and set IP:
    • 'My network places' -> properties -> 'Local area connection' -> properties -> 'Internal protocol (TCP/IP)' -> properties

Configuring Debian

Kernel modules/drivers

  • Settings for driver at boot time (ixgbe MQ=0,0)
    • Create file /etc/modprobe.d/ixgbe with content: options ixgbe MQ=0,0

Debugging

Memory leak detection

  • valgrind --tool=memcheck --leak-check=yes ./command_server_linux -p 4712

-- SergeyYurevich - 29 Nov 2010
Topic revision: r33 - 2011-04-19, SergeyYurevich
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki Send feedback | Imprint | Privacy Policy (in German)