From owner-freebsd-dtrace@freebsd.org Tue Aug 15 17:39:44 2017 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2A23DE2030 for ; Tue, 15 Aug 2017 17:39:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B91A7C3BE for ; Tue, 15 Aug 2017 17:39:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x22d.google.com with SMTP id d136so7925969qkg.3 for ; Tue, 15 Aug 2017 10:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+L4DajNon9AenRtgXwZJ0Px7ooHd6Y8c7A/J3uCJDjU=; b=uQ5SRIgqXUAr97Na5v6JqsKYak83tsvv+9Z+7upGbffi5v8WiiQMNYh4sEihhWSse7 ps96vtwn4T2/PCsoUzu0RUT6vL6GkGrxFRnFhtfszDUQexzxSrfBPP3urPq5Jay7Y1sX mGyOSJ2JZTZ1ikVevwrj4ECOzFofv0YxYvK8ndUE05f76v4lIGgYsZvNoR7Y1vMsf9GK 5A1uoIlItLlNjLHGGNIr4WFotigzV2isXFZhuAVlwZebx7oq4O9bGnyFa0YT2jM0V8gc b4j5trZKAtVboSFrP+uOZswcxI0seMhljb/5lhZeeIYCWj12WT0lDyluBJVskLMok7pF iePQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=+L4DajNon9AenRtgXwZJ0Px7ooHd6Y8c7A/J3uCJDjU=; b=sIuk+lcLyB2/5oIEc0oMy/hQmhNymn+MC483L2OdHRm2YF7m5+Xj1OHm8g8UodVEEa P62b0W213zerGlxxZJHDqWgzxoGxau3ZGatrtKo3J7fJ+t9CjWIV9+CQ0MG4+GxEOPTz 5HOreGWpPBHCqu9IkoE73f6eVwVq+fJVanVDkNoMY1PGKSc4Kgkmy+YK1+OIIZ4rmJJz W3nacTBoaRpas7eCRa7ra7wJ97DRzcjc4duAa0sFG6yhLgd5YxRrLoZRotkgLrU/g4LD qj0wRA1SiOGlGy+cZrVIBp1uf7uafBQNcZVHPP1l+fPXI8CbMODsi6A8g+W7ffKHsWe4 cv3g== X-Gm-Message-State: AHYfb5g4A4VDuxzNGKML9aKlbw0RUzIBzZFI/mOVa36cLINGOagTggUy jgJ5BOqBru4XIapH X-Received: by 10.55.18.202 with SMTP id 71mr7733210qks.174.1502818783573; Tue, 15 Aug 2017 10:39:43 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id w55sm7342997qth.76.2017.08.15.10.39.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Aug 2017 10:39:43 -0700 (PDT) Sender: Mark Johnston Date: Tue, 15 Aug 2017 10:40:45 -0700 From: Mark Johnston To: Anatoly Cc: freebsd-dtrace@freebsd.org Subject: Re: how to trace linux_open, linux_stat Message-ID: <20170815174045.GB44729@wkstn-mjohnston.west.isilon.com> References: <20170815201703.6e3052e5@asd2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170815201703.6e3052e5@asd2> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2017 17:39:44 -0000 On Tue, Aug 15, 2017 at 08:17:03PM +0300, Anatoly wrote: > Hello, I'm new to dtrace. I'm trying to run propiertary linux > application "1C thin client" (i386) using emulators/linux-c6 under > FreeBSD 11.1 amd64. Application starts, then stops shortly with error > message box and same error in log file: > 9db1fa37-b455-4f3f-b8dd-7de0ea7d6da3: File shared access error > 'v8stg://c:/1/FileStorage': ./src/storage.cpp(5013) > Thats why I put my hands on dtrace and trying to find out what this app > want to do. I'm not experienced in such a things, so I just take a > look at output of dtrace -l, and noted that there is linux_open and > linux_stat. Then I tried: > dtrace -n '::linux_open:entry { printf("%s %s", execname, > copyinstr(arg0)); }' > Thig gives output like: > dtrace: error on enabled probe ID 1 (ID 51007: > fbt:linux:linux_open:entry): invalid address (0xfffff80061022940) in > action #2 at DIF offset 12 > How can I print out arg0 here? With just (non-linux) open:entry it > works. The issue is that fbt::linux_open:entry is tracing an internal kernel function, while ::open:entry is tracing a syscall (syscall::open:entry). Looking at the output of "dtrace -lv -n ::linux_open:entry", I suspect you can get the info you want with: # dtrace -n '::linux_open:entry {printf("%s", copyinstr(args[1]->path);}' I'm not sure how syscall tracing for the Linux binary compat layer works. There is a linuxulator32 provider, but it doesn't seem to provide a probe for open(2).