public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Khalid Aziz <khalid@lyra.fc.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] ANNOUNCE: prctl tool
Date: Fri, 29 Sep 2000 20:29:10 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590678205529@msgid-missing> (raw)

I have written a tool called "prctl" that allows you to run a program
with a different handling of unaligned memory access than the default.
You can choose for the process to get a SIGBUS on an unaligned access or
unaligned access to be handled silently by the kernel. You can also use
it to start a shell with modified unaligned access handling. Further
details are in the man page at the end. One use for this tool could be
to find and fix all unaligned memory accesses in a program while running
the program under gdb which may improve the performance.

prctl makes use of the new options to prctl system call introduced in
2.4.0-test7 kernel, so it will not work on kernels older than
2.4.0-test7.

I have built binary RPM packages for IA-64 and IA-32, and a source RPM
package. These can be downloaded from the following URLs:

<ftp://ftp.hpl.hp.com/pub/linux-ia64/prctl-1.0-1.ia64.rpm>
<ftp://ftp.hpl.hp.com/pub/linux-ia32/prctl-1.0-1.i386.rpm>
<ftp://ftp.hpl.hp.com/pub/linux-ia64/prctl-1.0-1.src.rpm>

Please feel free to give any feedback on this tool.

---
Khalid

==================================
Khalid Aziz                        Unix System Enablement Laboratory
(970)898-9214                                        Hewlett-Packard
khalid@fc.hp.com                                    Fort Collins, CO
==================================


PRCTL(1)                                                 PRCTL(1)

NAME
       prctl - Process operations

SYNOPSIS
       prctl         [-v]         [-h|--help]         [--version]
       <-q|--unaligned=[silent|signal|default]> [command]

DESCRIPTION
       prctl allows you  to  query  or  control  certain  process
       behavior.   At  present, the only supported option is han­
       dling of unaligned memory accesses by a process.   When  a
       process  performs  an  unaligned memory access, by default
       the kernel would emulate the  unaligned  access  correctly
       and  log the unaligned access in syslog. This behavior can
       be  changed  so  the  kernel  could  either  emulate   the
       unaligned  access  correctly  without  logging an error or
       send SIGBUS to the process.

       prctl can optionally be followed by a command. If  a  com­
       mand  is  specified,  prctl will exec the command with the
       processor behavior set to as specified by the options.  If
       a  command  is  not specified, prctl will fork a new shell
       unless the command only queried the current settings.  The
       shell  started by prctl will be as defined by the environ­
       ment variable SHELL. If environment variable SHELL is  not
       defined,  shell in the password entry for the user will be
       started. If a shell is not found in  the  password  entry,
       bash will be started.

   OPTIONS
       -v     Verbose mode. In verbose mode, any new settings are
              confirmed with a message on stdout.

       --help Print usage information and exit.

       --version
              Print software version and exit.

       -q     Query the current settings for the process  options
              controllable by prctl.

       --unaligned=[silent|signal|default]]
              Set unaligned memory access behavior to not log the
              access (silent), send SIGBUS to the  process  (sig­
              nal),  or  do  the default (default). If a value is
              not  specified  after  "=",  current   setting   is
              returned.

       If  an  option  is  specified  multiple times, the last
              one takes effect.

EXAMPLES
       prctl --unaligned=signal
              starts  up  a  shell (as defined by the environment
              variable SHELL) and sets  up  any  process  running
              under   this  shell  to  be  sent  SIGBUS  upon  an
              unaligned memory access.

       prctl --unaligned=signal gdb tst
              starts up a gdb session for the program "tst"  with
              the  process  set  to  receive SIGBUS upon unligned
              memory access.

       prctl --unaligned              displays the current setting for  unaligned  memory
              access handling.

       prctl --unaligned= gdb tst
              displays  the  current setting for unaligned memory
              access handling and starts up a gdb session for the
              program "tst".

SEE ALSO
       prctl(2)

AUTHOR
       Khalid Aziz <khalid_aziz@hp.com>

LICENSE
       This software is made available under the GNU General Pub­
       lic License (GPL) Version 2.  This software comes with  NO
       WARRANTY.



                 reply	other threads:[~2000-09-29 20:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-105590678205529@msgid-missing \
    --to=khalid@lyra.fc.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox