Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file was generated automatically by ExtUtils::ParseXS version 2.18_02 from the |
| 3 | * contents of Context.xs. Do not edit this file, edit Context.xs instead. |
| 4 | * |
| 5 | * ANY CHANGES MADE HERE WILL BE LOST! |
| 6 | * |
| 7 | */ |
Wang Nan | 75e0b5f | 2015-01-19 20:43:17 +0800 | [diff] [blame] | 8 | #include <stdbool.h> |
| 9 | #ifndef HAS_BOOL |
| 10 | # define HAS_BOOL 1 |
| 11 | #endif |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 12 | #line 1 "Context.xs" |
| 13 | /* |
Arnaldo Carvalho de Melo | 765532c | 2010-12-23 13:10:22 -0200 | [diff] [blame] | 14 | * Context.xs. XS interfaces for perf script. |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 15 | * |
| 16 | * Copyright (C) 2009 Tom Zanussi <tzanussi@gmail.com> |
| 17 | * |
| 18 | * This program is free software; you can redistribute it and/or modify |
| 19 | * it under the terms of the GNU General Public License as published by |
| 20 | * the Free Software Foundation; either version 2 of the License, or |
| 21 | * (at your option) any later version. |
| 22 | * |
| 23 | * This program is distributed in the hope that it will be useful, |
| 24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 26 | * GNU General Public License for more details. |
| 27 | * |
| 28 | * You should have received a copy of the GNU General Public License |
| 29 | * along with this program; if not, write to the Free Software |
| 30 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 31 | * |
| 32 | */ |
| 33 | |
| 34 | #include "EXTERN.h" |
| 35 | #include "perl.h" |
| 36 | #include "XSUB.h" |
Tom Zanussi | 7397d80 | 2010-01-27 02:27:54 -0600 | [diff] [blame] | 37 | #include "../../../perf.h" |
| 38 | #include "../../../util/trace-event.h" |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 39 | |
| 40 | #ifndef PERL_UNUSED_VAR |
| 41 | # define PERL_UNUSED_VAR(var) if (0) var = var |
| 42 | #endif |
| 43 | |
Tom Zanussi | 7397d80 | 2010-01-27 02:27:54 -0600 | [diff] [blame] | 44 | #line 42 "Context.c" |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 45 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 46 | XS(XS_Perf__Trace__Context_common_pc); /* prototype to pass -Wmissing-prototypes */ |
| 47 | XS(XS_Perf__Trace__Context_common_pc) |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 48 | { |
| 49 | #ifdef dVAR |
| 50 | dVAR; dXSARGS; |
| 51 | #else |
| 52 | dXSARGS; |
| 53 | #endif |
| 54 | if (items != 1) |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 55 | Perl_croak(aTHX_ "Usage: %s(%s)", "Perf::Trace::Context::common_pc", "context"); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 56 | PERL_UNUSED_VAR(cv); /* -W */ |
| 57 | { |
| 58 | struct scripting_context * context = INT2PTR(struct scripting_context *,SvIV(ST(0))); |
| 59 | int RETVAL; |
| 60 | dXSTARG; |
| 61 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 62 | RETVAL = common_pc(context); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 63 | XSprePUSH; PUSHi((IV)RETVAL); |
| 64 | } |
| 65 | XSRETURN(1); |
| 66 | } |
| 67 | |
| 68 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 69 | XS(XS_Perf__Trace__Context_common_flags); /* prototype to pass -Wmissing-prototypes */ |
| 70 | XS(XS_Perf__Trace__Context_common_flags) |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 71 | { |
| 72 | #ifdef dVAR |
| 73 | dVAR; dXSARGS; |
| 74 | #else |
| 75 | dXSARGS; |
| 76 | #endif |
| 77 | if (items != 1) |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 78 | Perl_croak(aTHX_ "Usage: %s(%s)", "Perf::Trace::Context::common_flags", "context"); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 79 | PERL_UNUSED_VAR(cv); /* -W */ |
| 80 | { |
| 81 | struct scripting_context * context = INT2PTR(struct scripting_context *,SvIV(ST(0))); |
| 82 | int RETVAL; |
| 83 | dXSTARG; |
| 84 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 85 | RETVAL = common_flags(context); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 86 | XSprePUSH; PUSHi((IV)RETVAL); |
| 87 | } |
| 88 | XSRETURN(1); |
| 89 | } |
| 90 | |
| 91 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 92 | XS(XS_Perf__Trace__Context_common_lock_depth); /* prototype to pass -Wmissing-prototypes */ |
| 93 | XS(XS_Perf__Trace__Context_common_lock_depth) |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 94 | { |
| 95 | #ifdef dVAR |
| 96 | dVAR; dXSARGS; |
| 97 | #else |
| 98 | dXSARGS; |
| 99 | #endif |
| 100 | if (items != 1) |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 101 | Perl_croak(aTHX_ "Usage: %s(%s)", "Perf::Trace::Context::common_lock_depth", "context"); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 102 | PERL_UNUSED_VAR(cv); /* -W */ |
| 103 | { |
| 104 | struct scripting_context * context = INT2PTR(struct scripting_context *,SvIV(ST(0))); |
| 105 | int RETVAL; |
| 106 | dXSTARG; |
| 107 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 108 | RETVAL = common_lock_depth(context); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 109 | XSprePUSH; PUSHi((IV)RETVAL); |
| 110 | } |
| 111 | XSRETURN(1); |
| 112 | } |
| 113 | |
| 114 | #ifdef __cplusplus |
| 115 | extern "C" |
| 116 | #endif |
| 117 | XS(boot_Perf__Trace__Context); /* prototype to pass -Wmissing-prototypes */ |
| 118 | XS(boot_Perf__Trace__Context) |
| 119 | { |
| 120 | #ifdef dVAR |
| 121 | dVAR; dXSARGS; |
| 122 | #else |
| 123 | dXSARGS; |
| 124 | #endif |
| 125 | const char* file = __FILE__; |
| 126 | |
| 127 | PERL_UNUSED_VAR(cv); /* -W */ |
| 128 | PERL_UNUSED_VAR(items); /* -W */ |
| 129 | XS_VERSION_BOOTCHECK ; |
| 130 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 131 | newXSproto("Perf::Trace::Context::common_pc", XS_Perf__Trace__Context_common_pc, file, "$"); |
| 132 | newXSproto("Perf::Trace::Context::common_flags", XS_Perf__Trace__Context_common_flags, file, "$"); |
| 133 | newXSproto("Perf::Trace::Context::common_lock_depth", XS_Perf__Trace__Context_common_lock_depth, file, "$"); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 134 | if (PL_unitcheckav) |
| 135 | call_list(PL_scopestack_ix, PL_unitcheckav); |
| 136 | XSRETURN_YES; |
| 137 | } |
| 138 | |