From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86829C31E45 for ; Thu, 13 Jun 2019 16:35:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A8E820449 for ; Thu, 13 Jun 2019 16:35:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YG8USjoN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404043AbfFMQf1 (ORCPT ); Thu, 13 Jun 2019 12:35:27 -0400 Received: from mail-vs1-f50.google.com ([209.85.217.50]:40119 "EHLO mail-vs1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730724AbfFMHnd (ORCPT ); Thu, 13 Jun 2019 03:43:33 -0400 Received: by mail-vs1-f50.google.com with SMTP id a186so10111044vsd.7 for ; Thu, 13 Jun 2019 00:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=hotLWlJT65xEbJ61TV1i6ABCww+sxM3+UkKCRR2VvlQ=; b=YG8USjoNprxHuqspzE0bCI9G/czG9Bpmq8c13aybYyA2uPv6mGc4K/kxV4MKObBCXn VO+3wB0nSK56AukwJpc9eObDRy0A2QoLuOenXR7F19rKMHv1oprv0EJSU9/OSLYK+/Wi DtINoXmlSVoJSm0MdJn4WoLyREIFnkbXu66DmCl8r0+1jAaPvFRirQE3JcpguwggQTO3 rOUB3bIcW07qNreqZOk/9lUnR2zylA5EjK/TyuvsxZTOODEcKwebcMHh4Q0GnNy53JvS aCd51/jxleDuBriRwzn/g3axx6jkj6M8y3RW4XGcXLvGCkcO8MaoUzyBf+IanrvLpBZG ct4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=hotLWlJT65xEbJ61TV1i6ABCww+sxM3+UkKCRR2VvlQ=; b=NjJFCdWfYAi7YDCA5h2S5daQYJPA2iDVHkKPIbkncAKuKtLc0ZEiv44+PG3UEY/p2p mb5A/R6Rp7hgkWyGjt748I32TnBS3Wmu+CbMcC2MZDtZryjvTDRQNEYZxcjsR47uxU16 SzWhqnm3e3vt4zcsSlkdJWQxtxPlRmJ4TqhsEOdtOh1DaVPAmE9TRQUdfbUKjzy4nFoE ObxtcLGMPIiYjp/mdwOgFa1ua9MYfY9+eaNBVG00cbyoguXYcwDCGEP6Jn+0zC/+P/Cs u0YCN5Ao4N4CFU9HuxkRXvADD57bmqUGxSfV3GT1oJBzfFo1r9teAba1snHW32rAdhOm gTkw== X-Gm-Message-State: APjAAAV83yJjg8wzdZ5KlGOKLtntEY04jHg9R9/I8QjbVDr+mCUtPtLT PsizCFJdBOlmvlRvjMPUec1cdFZ+KLD9bzGVz3n1zAskX0M= X-Google-Smtp-Source: APXvYqwrVqv21Jxe7l7wvY0AC21Hp5Db9lwc3hNEGCAT2hhOG+q80MLPYviUu6jdSvuDaiyfqXClOX/k5IbPqJjTvgI= X-Received: by 2002:a67:ec5a:: with SMTP id z26mr43636516vso.144.1560411812380; Thu, 13 Jun 2019 00:43:32 -0700 (PDT) MIME-Version: 1.0 From: Pintu Agarwal Date: Thu, 13 Jun 2019 13:13:21 +0530 Message-ID: Subject: Pause a process execution from external program To: kernelnewbies@kernelnewbies.org, open list , pedro@palves.net Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, I was just wondering if this is possible in the Linux world. My requirement is: For some reason, I want to halt/pause the execution (for some specified time) of a running process/thread (at some location), without modified the source, may be by firing some events/signals from an another external program, by specifying the address location or a line number. Is this possible ? May be by using some system call, or other mechanism using the process PID. Assume that its a debugging system with all root privileges. Basically, its just like how "gdb" is able to set the break-point in a program, and able to stop its execution exactly at that location. I am wondering what mechanism "gdb" uses to do this? I tried to check here, but could find the exact place, where this is handled: https://github.com/bminor/binutils-gdb/blob/master/gdb/breakpoint.c Unfortunately, I cannot use "gdb", but I wanted to borrow this mechanism only to serve my purpose. If anyone is aware, please let me know. I will share my findings here, after I get some useful results of my experimentation. Thank you for your help! Regards, Pintu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE8F0C31E45 for ; Thu, 13 Jun 2019 07:45:09 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A62920851 for ; Thu, 13 Jun 2019 07:45:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YG8USjoN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A62920851 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92) (envelope-from ) id 1hbKPV-0003im-Hw; Thu, 13 Jun 2019 03:44:37 -0400 Received: from mail-vs1-xe2b.google.com ([2607:f8b0:4864:20::e2b]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1hbKPT-0003ie-Df for kernelnewbies@kernelnewbies.org; Thu, 13 Jun 2019 03:44:35 -0400 Received: by mail-vs1-xe2b.google.com with SMTP id v129so11990354vsb.11 for ; Thu, 13 Jun 2019 00:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=hotLWlJT65xEbJ61TV1i6ABCww+sxM3+UkKCRR2VvlQ=; b=YG8USjoNprxHuqspzE0bCI9G/czG9Bpmq8c13aybYyA2uPv6mGc4K/kxV4MKObBCXn VO+3wB0nSK56AukwJpc9eObDRy0A2QoLuOenXR7F19rKMHv1oprv0EJSU9/OSLYK+/Wi DtINoXmlSVoJSm0MdJn4WoLyREIFnkbXu66DmCl8r0+1jAaPvFRirQE3JcpguwggQTO3 rOUB3bIcW07qNreqZOk/9lUnR2zylA5EjK/TyuvsxZTOODEcKwebcMHh4Q0GnNy53JvS aCd51/jxleDuBriRwzn/g3axx6jkj6M8y3RW4XGcXLvGCkcO8MaoUzyBf+IanrvLpBZG ct4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=hotLWlJT65xEbJ61TV1i6ABCww+sxM3+UkKCRR2VvlQ=; b=lPxZ+9evMeIU+dV4W4BcI0jNDY0+PsZ1/Y/mn2kXk96xNvDzb6O/yEU8fhw0D6ZIMC VEu8UNN0tIJvdUyKpkw/soMv7CcrCT1X30o87eDh7oA/lELgTpNBI5A7Kqr4Cxlnt4AT z6dFmeO8H80l9BBf1qJU+rbPhT+nuXP4JVBG9FOmBhOCzXoDUq/hHEX/jJtsN8j62/mz /a8hmo5ICT6zgVslWwRwn+qHEeE1fXGRbrSC2jvelcwP3VdCYLpjvn/0MneE6oDYu/m5 u91HNIhDIPO7CUlu2En82lbGF0vGMjbI3jHAJCGoDtn4kUzT/S3NkkMaonocEJV8sF3t emmw== X-Gm-Message-State: APjAAAWbtN7qbGyILrO6um+D30jee9rh8OZzJtLk+b9ddMYXh7KNjRUx SSeV1dOQpjqgpjKmq8+quDnElLkgPDc9hFDniF3AUIwCezg= X-Google-Smtp-Source: APXvYqwrVqv21Jxe7l7wvY0AC21Hp5Db9lwc3hNEGCAT2hhOG+q80MLPYviUu6jdSvuDaiyfqXClOX/k5IbPqJjTvgI= X-Received: by 2002:a67:ec5a:: with SMTP id z26mr43636516vso.144.1560411812380; Thu, 13 Jun 2019 00:43:32 -0700 (PDT) MIME-Version: 1.0 From: Pintu Agarwal Date: Thu, 13 Jun 2019 13:13:21 +0530 Message-ID: Subject: Pause a process execution from external program To: kernelnewbies@kernelnewbies.org, open list , pedro@palves.net X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hi All, I was just wondering if this is possible in the Linux world. My requirement is: For some reason, I want to halt/pause the execution (for some specified time) of a running process/thread (at some location), without modified the source, may be by firing some events/signals from an another external program, by specifying the address location or a line number. Is this possible ? May be by using some system call, or other mechanism using the process PID. Assume that its a debugging system with all root privileges. Basically, its just like how "gdb" is able to set the break-point in a program, and able to stop its execution exactly at that location. I am wondering what mechanism "gdb" uses to do this? I tried to check here, but could find the exact place, where this is handled: https://github.com/bminor/binutils-gdb/blob/master/gdb/breakpoint.c Unfortunately, I cannot use "gdb", but I wanted to borrow this mechanism only to serve my purpose. If anyone is aware, please let me know. I will share my findings here, after I get some useful results of my experimentation. Thank you for your help! Regards, Pintu _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies