1. 17 Jul, 2014 2 commits
    • Philippe Gerum's avatar
      cobalt/timer: assign handler identifier as default timer name · 05ea3c68
      Philippe Gerum authored
      Timer name and handler name are redundant. Drop the latter, but assign
      it as the timer's default name until xntimer_set_name() is called.
      05ea3c68
    • Philippe Gerum's avatar
      cobalt/timer: introduce context-sensitive timer gravity · a7147eb6
      Philippe Gerum authored
      Applying a single gravity value for anticipating on all timer shots -
      regardless of what the issuing timer is being used for - falls short
      of considering the proper latency attached to the context. This leads
      to poor tuning, with either negative latencies (i.e. early shots)
      observed on measuring the jitter for irq handlers, or higher latencies
      than expected for user-space threads when using too optimistic
      (i.e. small) clock gravities.
      
      Typically, the distance between the core clock handler and the
      associated kernel-based handler the former calls, is much shorter than
      what has to be traversed for switching in a kernel thread. It is even
      shorter than the latency incurred for switching a user-space thread
      from the core clock handler.
      
      To solve this, we differentiate timers on the final context they
      activate, between irq(handler), kernel and user threads, using the
      appropriate gravity value when planning for the next shot, on a
      per-timer basis, instead of using a single per-clock gravity as
      previously.
      
      Two additional contexts (irq and kernel) are added to the clock
      gravity settings. The user can pass a hint to xntimer_init() for
      indicating which kind of context will be activated by this timer (see
      XNTIMER_[IKU]GRAVITY).
      
      There are side-effects for this change on the procfs support:
      
      - the information previously available from the xenomai/timer entry is
        now obtained by reading xenomai/clock/coreclk. In addition, the
        clock gravity values are reported.
      
      - the former contents of xenomai/clock/* entries (i.e. the list of
        active timers running on the associated clock) is now available from
        the new xenomai/timer/* entries, also indexed on the clock name.
      
      Writing to an entry under xenomai/clock/* can be used to change the
      gravity values of the associated clock.
      
      /* change the user gravity (default) */
      echo 3000 > /proc/xenomai/clock/coreclck
      /* change the IRQ gravity */
      echo 1000i > /proc/xenomai/clock/coreclck
      /* change the user and kernel gravities */
      echo "2000u 1000k" > /proc/xenomai/clock/coreclck
      a7147eb6
  2. 16 Jul, 2014 1 commit
  3. 14 Jul, 2014 1 commit
  4. 10 Jul, 2014 2 commits
  5. 09 Jul, 2014 1 commit
  6. 08 Jul, 2014 1 commit
  7. 06 Jul, 2014 1 commit
  8. 05 Jul, 2014 3 commits
  9. 04 Jul, 2014 1 commit
  10. 03 Jul, 2014 4 commits
  11. 02 Jul, 2014 3 commits
    • Philippe Gerum's avatar
      drivers/testing: fix adaptive switch for ioctl() rt/nrt pair · 442b3b3c
      Philippe Gerum authored
      bec5d0dd introduced a subtle regression causing switchtest to fail
      initializing, due to ioctl() calls receiving ENOTTY.
      
      As ioctl() became a conforming call, a Xenomai thread now runs the
      ioctl_rt handler first, which should therefore implement all requests
      that may be submitted in such context, or cause the adaptive switch to
      take place by returning ENOSYS, so that ioctl_nrt is probed next.
      442b3b3c
    • Jorge Ramirez-Ortiz's avatar
      drivers/analogy/testing: clarify apparent error during cmd_write operation · 30266978
      Jorge Ramirez-Ortiz authored and Philippe Gerum's avatar Philippe Gerum committed
          This change helps the user understand the following use case.
      
          1. The user loads the fake driver and requests reading from subd 3. By
          default, cmd_read attempts to read 100 triggered scans; the call will
          run until all the data has been received.
      
                  $ ./cmd_read -d analogy0 -s 3
      
          2. The user, on a separate thread, writes to subd 2; since subd2 and
          subd3 implement a loop device, a write to subd2 will be copied on to
          the async buffer of subd3.
      
              $./cmd_write -v -d analogy0 -s 2 -i file.txt
      
          When file.txt is much larger than 100 scans, the cmd_write function will
          end up failing in one of the block transfers. This is not an error but
          due to the fact that the cmd_read completion on subd3 also cancels any
          on going requests on subd2 (note: use wf_generate to create the
          samples in file.txt).
      
          If you enabled ftrace, this should look like this:
      
          [root@xenobot xenomai]# cat /proc/analogy/00-analogy_fake
          --  Subdevices --
      
          | idx | type
          |  00 | Analog input subdevice
          |  01 | Digital input/output subdevice
          |  02 | Analog output subdevice
          |  03 | Analog input subdevice
      
          [root@xenobot xenomai]# cat /sys/kernel/debug/tracing/trace
                  modprobe-1856  [000] ....   158.289528: a4l_register_drv:  name=analogy_fake
                  modprobe-1856  [000] ....   158.289540: a4l_lct_drv:  name=analogy_fake
            analogy_config-1858  [000] ....   159.566561: a4l_lct_drv:  name=analogy_fake
            analogy_config-1858  [000] ....   159.566568: test_attach: analogy_fake: starting attach procedure...
            analogy_config-1858  [000] ....   159.566571: test_attach: analogy_fake:  AI subdev registered
            analogy_config-1858  [000] ....   159.566574: test_attach: analogy_fake:  DIO subdev registered
            analogy_config-1858  [000] ....   159.566577: test_attach: analogy_fake:  AO subdev registered
            analogy_config-1858  [000] ....   159.566580: test_attach: analogy_fake:  AI2 subdev registered
            analogy_config-1858  [000] ....   159.570938: test_attach: analogy_fake: attach procedure completed: adiv = 1, qcount = 1
            analogy_config-1858  [000] ....   159.570943: a4l_setup_transfer:  nb_subd=4
                  cmd_read-1870  [000] ....   164.521176: a4l_fill_cmddesc:  desc dump
                  cmd_read-1870  [000] ....   164.521190: a4l_fill_cmddesc:       ->idx_subd=3
                  cmd_read-1870  [000] ....   164.521199: a4l_fill_cmddesc:       ->flags=0
                  cmd_read-1870  [000] ....   164.521208: a4l_fill_cmddesc:       ->nb_chan=4
                  cmd_read-1870  [000] ....   164.521216: a4l_fill_cmddesc:       ->chan_descs=0x0
                  cmd_read-1870  [000] ....   164.521245: a4l_fill_cmddesc:       ->data_len=0
                  cmd_read-1870  [000] ....   164.521254: a4l_fill_cmddesc:       ->pdata=0x          (null)
                  cmd_read-1870  [000] ....   164.521264: a4l_ioctl_cmd:  1st cmd checks passed
                  cmd_read-1870  [000] ....   164.521272: a4l_ioctl_cmd:  driver's cmd checks passed
                  cmd_read-1870  [000] ....   164.521282: a4l_setup_buffer:  end_count=800
                  cmd_read-1870  [000] ....   164.521292: ai2_cmd: analogy_fake:  (subd=3)
                  cmd_read-1870  [000] ....   164.521460: a4l_read_buffer: a4l_buffer=0xffff88007a501a00, p=0xffffc9000008f000
                  cmd_read-1870  [000] ....   164.521470: a4l_read_buffer: end=000800, prd=000000, cns=000000, tmp=000000
                 cmd_write-1905  [000] ....   200.797349: a4l_fill_cmddesc:  desc dump
                 cmd_write-1905  [000] ....   200.797356: a4l_fill_cmddesc:       ->idx_subd=2
                 cmd_write-1905  [000] ....   200.797361: a4l_fill_cmddesc:       ->flags=0
                 cmd_write-1905  [000] ....   200.797365: a4l_fill_cmddesc:       ->nb_chan=2
                 cmd_write-1905  [000] ....   200.797368: a4l_fill_cmddesc:       ->chan_descs=0x0
                 cmd_write-1905  [000] ....   200.797372: a4l_fill_cmddesc:       ->data_len=0
                 cmd_write-1905  [000] ....   200.797376: a4l_fill_cmddesc:       ->pdata=0x          (null)
                 cmd_write-1905  [000] ....   200.797380: a4l_ioctl_cmd:  1st cmd checks passed
                 cmd_write-1905  [000] ....   200.797384: a4l_ioctl_cmd:  driver's cmd checks passed
                 cmd_write-1905  [000] ....   200.797388: a4l_setup_buffer:  end_count=0
                 cmd_write-1905  [000] ....   200.797393: ao_cmd: analogy_fake:  (subd=2)
                 cmd_write-1905  [000] ....   200.804176: a4l_write_buffer: a4l_buffer=0xffff88007a505200, p=0xffffc90000134000
                 cmd_write-1905  [000] ....   200.804184: a4l_write_buffer: end=000000, prd=000000, cns=000000, tmp=000000
                 cmd_write-1905  [000] ....   200.804192: a4l_write_buffer: analogy_fake:  buf->prd_cnt=4096
                 cmd_write-1905  [000] ....   200.804256: ao_trigger: analogy_fake:  (subd=2)
                  cmd_read-1870  [000] ....   200.804379: a4l_read_buffer: a4l_buffer=0xffff88007a501a00, p=0xffffc9000008f000
                  cmd_read-1870  [000] ....   200.804385: a4l_read_buffer: end=000800, prd=004096, cns=000000, tmp=000000
                  cmd_read-1870  [000] ....   200.804392: a4l_read_buffer: analogy_fake:  buf->cns_cnt=800
                     <...>-1860  [001] ....   200.804438: ao_pull_values: analogy_fake:  4096 bytes added to private buffer from async p=ffffc90000134000
                     <...>-1860  [001] ....   200.804448: ai2_push_values: analogy_fake:  4096 bytes added to async buffer p=ffffc9000008f000
                  cmd_read-1870  [000] ....   200.805363: a4l_read_buffer: a4l_buffer=0xffff88007a501a00, p=0xffffc9000008f000
                  cmd_read-1870  [000] ....   200.805367: a4l_read_buffer: end=000800, prd=004096, cns=000800, tmp=000000
                  cmd_read-1870  [000] d...   200.805371: a4l_read_buffer: a4l_read: acquisition done - all data requested by the client was delivered
                  cmd_read-1870  [000] ....   200.805375: ai2_cancel: analogy_fake:  (subd=3)
                  cmd_read-1870  [000] ....   200.805379: ai2_cancel: analogy_fake:  subd 3 cancelling subd 2 too
                 cmd_write-1905  [000] ....   200.806266: a4l_write_buffer: a4l_buffer=0xffff88007a505200, p=0xffffc90000134000
                 cmd_write-1905  [000] ....   200.806273: a4l_write_buffer: end=000000, prd=004096, cns=004096, tmp=000000
                 cmd_write-1905  [000] ....   200.806282: ao_cancel: analogy_fake:  (subd=2)
      30266978
    • Jorge Ramirez-Ortiz's avatar
      drivers/analogy: add ftrace support to a4l_dbg and a4l_info · ef97407c
      Jorge Ramirez-Ortiz authored and Philippe Gerum's avatar Philippe Gerum committed
      Enable ftrace support in the analogy debug config
      ef97407c
  12. 01 Jul, 2014 1 commit
    • Philippe Gerum's avatar
      cobalt: fix naming consistency issues with *_np() calls · 50bd5540
      Philippe Gerum authored
      To match the GNU extension equivalent, pthread_set_name_np() is
      renamed to pthread_setname_np(). For consistency with the previous
      change, pthread_set_mode_np() becomes pthread_setmode_np().
      
      The former calls will be available from the upcoming transition kit.
      50bd5540
  13. 30 Jun, 2014 3 commits
  14. 26 Jun, 2014 1 commit
    • Philippe Gerum's avatar
      cobalt/thread: enable SIGDEBUG on denied lock break detection · 3eeb8249
      Philippe Gerum authored
      Send SIGDEBUG to the thread being denied a suspension/sleep state due
      to XNTRAPLB, if the atypical/abnormal detection feature is armed.
      The new SIGDEBUG_LOCK_BREAK alert code matches this case in the
      siginfo data conveyed by SIGDEBUG.
      
      At this chance, the related TCB state and information flag names have
      been updated to better reflect the semantics:
      
      XNTRAPSW -> XNWARN (SIGDEBUG warning enabled for atypical/abnormal
      conditions)
      
      XNSWREP -> XNPIALERT (Priority inversion alert sent [via SIGDEBUG])
      3eeb8249
  15. 25 Jun, 2014 1 commit
  16. 24 Jun, 2014 5 commits
  17. 22 Jun, 2014 1 commit
  18. 17 Jun, 2014 2 commits
    • Philippe Gerum's avatar
      rtdm: introduce rtdm_task_join(), deprecate rtdm_task_join_nrt() · 8e161d18
      Philippe Gerum authored
      The new rtdm_task_join() service may be called regardless of the
      current execution mode, therefore rtdm_task_join_nrt() becomes
      pointless and will be phased out in the next release.
      8e161d18
    • Philippe Gerum's avatar
      cobalt/posix: drop pthread_make_periodic_np/wait_period_np services · bf112060
      Philippe Gerum authored
      We have no more in-tree users of these calls.
      
      With the introduction of services to support real-time signals, those
      two non-portable calls have become redundant. Instead, Cobalt-based
      applications should set up a periodic timer using the
      timer_create()+timer_settime() call pair, then wait for release points
      via sigwaitinfo(). Overruns can be detected by looking at the
      siginfo.si_overrun field.
      
      Alternatively, applications may obtain a file descriptor referring to
      a Cobalt timer via the timerfd() call, and read() from it to wait for
      timeouts.
      
      In addition, applications may include a timer in a synchronous
      multiplexing operation involving other event sources, by passing a
      file descriptor returned by the timerfd() service to a select() call.
      bf112060
  19. 15 Jun, 2014 1 commit
  20. 14 Jun, 2014 2 commits
  21. 12 Jun, 2014 2 commits
  22. 10 Jun, 2014 1 commit